Documentation
¶
Index ¶
- func RenameYamlKey(rootNode *yaml.Node, path []string, newKey string) error
- func TransformNode(rootNode *yaml.Node, path []string, transform func(node *yaml.Node) error) error
- func UpdateYamlValue(yamlBytes []byte, path []string, value string) ([]byte, 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.
func UpdateYamlValue ¶
takes a yaml document in bytes, a path to a key, and a value to set. The value must be a scalar.
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.