Documentation ¶
Index ¶
- func Traverse[T NodeTraverser](node T, f TraversalFunc) (T, error)
- type Metadata
- type Node
- func (n *Node) GetBasePath() string
- func (n *Node) GetMetadata() Metadata
- func (n *Node) GetName() []string
- func (n *Node) GetParent() NodeTraverser
- func (n *Node) SetBasePath(path string)
- func (n *Node) SetMetadata(metadata Metadata)
- func (n *Node) SetName(name string)
- func (n *Node) SetParent(parent NodeTraverser)
- type NodeTraverser
- type Noder
- type TraversalFunc
- type Traverser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Traverse ¶
func Traverse[T NodeTraverser](node T, f TraversalFunc) (T, error)
Traverse takes a NodeTraverser Node and enters into a recursive loop (traverseRecursor) that applies a given function to the Node.
Types ¶
type Node ¶
type Node struct { Name string // contains filtered or unexported fields }
func (*Node) GetBasePath ¶
func (*Node) GetMetadata ¶
GetMetadata reads metadata from the root node of the tree
func (*Node) GetParent ¶
func (n *Node) GetParent() NodeTraverser
func (*Node) SetBasePath ¶
func (*Node) SetMetadata ¶
SetMetadata sets metadata for the root node of the tree
func (*Node) SetParent ¶
func (n *Node) SetParent(parent NodeTraverser)
type NodeTraverser ¶
func ResolveRefs ¶
func ResolveRefs(key string, parent, node NodeTraverser) (NodeTraverser, error)
ResolveRefs calls readRef on references with the ref path modified appropriately for it's use
type TraversalFunc ¶
type TraversalFunc func(key string, parent, child NodeTraverser) (NodeTraverser, error)
type Traverser ¶
type Traverser interface { GetChildren() map[string]NodeTraverser SetChild(i string, t NodeTraverser) GetParent() NodeTraverser SetParent(parent NodeTraverser) }
Click to show internal directories.
Click to hide internal directories.