Documentation ¶
Index ¶
- func GetMap(n *yaml.Node, name string) map[string]*yaml.Node
- func GetMapValue(n *yaml.Node, key string) (*yaml.Node, *yaml.Node, error)
- func GetPath(node *yaml.Node, path []interface{}) (*yaml.Node, error)
- func GetValue(n *yaml.Node, name string) string
- func MatchAll(node *yaml.Node, path string) <-chan *yaml.Node
- func MatchOne(node *yaml.Node, path string) *yaml.Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMap ¶ added in v1.20.0
GetMap returns a map of the names and values in a MappingNode This is a shorthand version of calling GetMapValue and iterating over the results. One difference is that keys will no longer be in their original order, which matters for several use cases like processing Constants.
func GetMapValue ¶
GetMapValue returns the key and value nodes from node that matches key. if node is not a mapping node or the key does not exist, GetMapValue returns nil
func GetPath ¶
func GetPath(node *yaml.Node, path []interface{}) (*yaml.Node, error)
GetPath returns the node by descending into map and array nodes for each element of path
func GetValue ¶ added in v1.20.0
GetValue tries to get a scalar value from a mapping node If anything goes wrong, it returns an empty string. Use GetMapValue if you need more control.
func MatchAll ¶
func MatchAll(node *yaml.Node, path string) <-chan *yaml.Node
MatchAll returns all yaml nodes that match the provided path. The path is a `/`-separated string that describes a path into the template's tree. Wildcard elements (which can be map keys or array indices) are represented by a `*`. Matching an arbitrary number (including zero) of descendents can be done with `**`.
Types ¶
This section is empty.