Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container interface {
Get(key string) (*Node, error)
Set(key string, val *Node) error
Add(key string, val *Node) error
Remove(key string) error
}
Container is the interface for performing operations on Nodes
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node holds a YAML document that has not yet been processed into a NodeMap or NodeSlice
func NewNode ¶
func NewNode(raw *interface{}) *Node
NewNode returns a new Node. It expects a pointer to an interface{}
func (*Node) IsNodeSlice ¶
IsNodeSlice returns whether the contents it holds is a slice or not
func (*Node) MarshalYAML ¶
MarshalYAML implements yaml.Marshaler, and returns the correct interface{} to be marshaled
func (*Node) NodeMap ¶
NodeMap returns the node as a NodeMap, if the raw interface{} it holds is indeed a map[interface{}]interface{}
func (*Node) NodeSlice ¶
NodeSlice returns the node as a NodeSlice, if the raw interface{} it holds is indeed a []interface{}
func (*Node) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler
type NodeMap ¶
type NodeMap map[interface{}]*Node
NodeMap represents a YAML object
type NodeSlice ¶
type NodeSlice []*Node
NodeSlice represents a YAML array
type OpPath ¶
type OpPath string
OpPath is an RFC6902 'pointer'
func (*OpPath) ContainsExtendedSyntax ¶
ContainsExtendedSyntax returns whether the OpPath uses the "key=value" format, as in "/foo/name=bar", where /foo points at an array that contains an object with a key "name" that has a value "bar"
type Operation ¶
type Operation struct {
Op Op `yaml:"op,omitempty"`
Path OpPath `yaml:"path,omitempty"`
From OpPath `yaml:"from,omitempty"`
RawValue *interface{} `yaml:"value,omitempty"`
}
Operation is an RFC6902 'Operation' https://tools.ietf.org/html/rfc6902#section-4