yaml

package
v0.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteNode

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

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

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

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

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

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL