Documentation
¶
Index ¶
- Constants
- func ContextWithConfig(ctx context.Context, config *Config) context.Context
- func CreateOrUpdateKeyNode(ctx context.Context, key string, keyNode *yaml.Node) *yaml.Node
- func CreateOrUpdateMapNodeElement(ctx context.Context, key string, keyNode, valueNode, mapNode *yaml.Node) *yaml.Node
- func CreateOrUpdateScalarNode(ctx context.Context, value any, valueNode *yaml.Node) *yaml.Node
- func CreateOrUpdateSliceNode(ctx context.Context, elements []*yaml.Node, valueNode *yaml.Node) *yaml.Node
- func DeleteMapNodeElement(ctx context.Context, key string, mapNode *yaml.Node) *yaml.Node
- func GetMapElementNodes(ctx context.Context, mapNode *yaml.Node, key string) (*yaml.Node, *yaml.Node, bool)
- func Walk(ctx context.Context, node *yaml.Node, visit VisitFunc) error
- type Config
- type OutputFormat
- type VisitFunc
Constants ¶
View Source
const ( // ErrTerminate is a sentinel error that can be returned from a Walk function to terminate the walk. ErrTerminate = errors.Error("terminate") )
Variables ¶
This section is empty.
Functions ¶
func ContextWithConfig ¶
func CreateOrUpdateKeyNode ¶
func CreateOrUpdateSliceNode ¶
func DeleteMapNodeElement ¶
func GetMapElementNodes ¶
Types ¶
type Config ¶
type Config struct {
KeyStringStyle yaml.Style // The default string style to use when creating new keys
ValueStringStyle yaml.Style // The default string style to use when creating new nodes
Indentation int // The indentation level of the document
OutputFormat OutputFormat // The output format to use when marshalling
}
func GetConfigFromContext ¶
type OutputFormat ¶
type OutputFormat string
const ( OutputFormatJSON OutputFormat = "json" OutputFormatYAML OutputFormat = "yaml" )
Click to show internal directories.
Click to hide internal directories.