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 LookupKey ¶ added in v0.51.0
func LookupKey(node *yaml.Node, key string) (*yaml.Node, *yaml.Node)
func RemoveKey ¶ added in v0.51.0
func RemoveKey(node *yaml.Node, key string) (*yaml.Node, *yaml.Node)
Returns the key and value if they were present
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.
func Walk ¶ added in v0.42.0
Traverses a yaml document, calling the callback function for each node. The callback is expected to modify the node in place
func YamlMarshal ¶ added in v0.48.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.