Documentation
¶
Index ¶
- func LookupKey(node *yaml.Node, key string) (*yaml.Node, *yaml.Node)
- func RemoveKey(node *yaml.Node, key string) (*yaml.Node, *yaml.Node)
- func RenameYamlKey(rootNode *yaml.Node, path []string, newKey string) (error, bool)
- func TransformNode(rootNode *yaml.Node, path []string, transform func(node *yaml.Node) error) error
- func Walk(rootNode *yaml.Node, callback func(node *yaml.Node, path string)) error
- func YamlMarshal(node *yaml.Node) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenameYamlKey ¶
Takes the root node of a yaml document, a path to a key, and a new name for the key. Will rename the key to the new name if it exists, and do nothing otherwise.
func TransformNode ¶ added in v0.47.0
Walks a yaml document from the root node to the specified path, and then applies the transformation to that node. If the requested path is not defined in the document, no changes are made to the document.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.