controller-tools: Index | Files

package yaml

import ""


Package Files

convert.go nested.go set.go

func DeleteNode Uses

func DeleteNode(root *yaml.Node, path ...string) error

DeleteNode deletes the node at the given path in the given tree of mapping nodes. It's a noop if the path doesn't exist.

func GetNode Uses

func GetNode(root *yaml.Node, path ...string) (*yaml.Node, bool, error)

GetNode gets the node at the given path in the given sequence of mapping nodes, or, if it doesn't exist, returning false.

func SetNode Uses

func SetNode(root *yaml.Node, val yaml.Node, path ...string) error

SetNode sets the given path to the given yaml Node, creating mapping nodes along the way.

func SetStyle Uses

func SetStyle(root *yaml.Node, style yaml.Style)

SetStyle sets the style for all nodes in the given node tree to the given style.

func ToYAML Uses

func ToYAML(rawObj interface{}) (*yaml.Node, error)

ToYAML converts some object that serializes to JSON into a YAML node tree. It's useful since it pays attention to JSON tags, unlike yaml.Unmarshal or yaml.Node.Decode.

func ValueInMapping Uses

func ValueInMapping(root *yaml.Node, key string) (*yaml.Node, error)

ValueInMapping finds the value node with the corresponding string key in the given mapping node. If the given node is not a mapping, an error will be returned.

Package yaml imports 3 packages (graph) and is imported by 2 packages. Updated 2019-08-29. Refresh now. Tools for package owners.