astyaml

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotDocumentNode = errors.New("Can only convert from document node")
	ErrNotMappingNode  = errors.New("Tried to change the key of a node which is not a mapping node")
	ErrKeyNotFound     = errors.New("Key to be replaced not found")
)

Functions

This section is empty.

Types

type YamlNode

type YamlNode struct {
	yaml.Node
	// contains filtered or unexported fields
}

func FromYamlDocumentNode

func FromYamlDocumentNode(n yaml.Node) (YamlNode, error)

func (*YamlNode) ChangeKey

func (n *YamlNode) ChangeKey(oldKeyName, newKeyName string, newValue YamlNode) error

ChangeKey replaces the oldkey with a new key/value pair. Useful for patching up a tree parsed from yaml but then used for validating an ignition structure

func (*YamlNode) ChangeTreeTag

func (n *YamlNode) ChangeTreeTag(newTag string)

ChangeTreeTag changes the value Tag() returns to newTag

func (YamlNode) KeyLineCol

func (n YamlNode) KeyLineCol(source io.ReadSeeker) (int, int, string)

func (YamlNode) KeyValueMap

func (n YamlNode) KeyValueMap() (map[string]astnode.AstNode, bool)

func (YamlNode) LiteralValue

func (n YamlNode) LiteralValue() interface{}

func (YamlNode) SliceChild

func (n YamlNode) SliceChild(index int) (astnode.AstNode, bool)

func (YamlNode) Tag

func (n YamlNode) Tag() string

func (YamlNode) ValueLineCol

func (n YamlNode) ValueLineCol(source io.ReadSeeker) (int, int, string)

Jump to

Keyboard shortcuts

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