Documentation ¶
Overview ¶
Package config contains the configuration tree
Package config contains the configuration tree
Index ¶
- func SimulateTrafficCounters(ctx context.Context, delay time.Duration, node *Node)
- type Node
- func (n *Node) Add(name string, key map[string]string, value *gnmi.TypedValue) *Node
- func (n *Node) AddPath(path string, value *gnmi.TypedValue) *Node
- func (n *Node) Delete(name string, key map[string]string) *Node
- func (n *Node) DeletePath(path string) *Node
- func (n *Node) FindAll(path string) []*Node
- func (n *Node) Get(name string, key map[string]string) *Node
- func (n *Node) GetPath(path string) *Node
- func (n *Node) Key() map[string]string
- func (n *Node) MatchesKey(key map[string]string) bool
- func (n *Node) Name() string
- func (n *Node) Path() string
- func (n *Node) ReplacePath(path string, value *gnmi.TypedValue) *Node
- func (n *Node) Value() *gnmi.TypedValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a single node in the configuration tree
func NewSwitchConfig ¶
NewSwitchConfig creates a new switch skeleton configuration and returns its root node
func (*Node) Add ¶
Add adds a child node, identified by name and key; if the node already exists, it will not be replaced, but it's value will be updated
func (*Node) AddPath ¶
func (n *Node) AddPath(path string, value *gnmi.TypedValue) *Node
AddPath iteratively adds the nodes along the given path and returns the last node added
func (*Node) Delete ¶
Delete deletes the specified child node, identified by name and key; returns the deleted node or nil if node did not exist
func (*Node) DeletePath ¶
DeletePath iteratively gets the nodes along the given path and deletes the last node specified; nil if not found
func (*Node) FindAll ¶
FindAll finds all nodes matching the specified path, which can include wildcard "..." as key value
func (*Node) Get ¶
Get finds the immediate child node, identified by name and key; returns nil if the node does not exist
func (*Node) GetPath ¶
GetPath iteratively gets the nodes along the given path and returns the last node specified; nil if not found
func (*Node) MatchesKey ¶
MatchesKey returns true if the node's key matches the given key, which can include wild-cards
func (*Node) ReplacePath ¶
func (n *Node) ReplacePath(path string, value *gnmi.TypedValue) *Node
ReplacePath performs like AddPath, but replaces the leaf node entirely, including its child nodes
func (*Node) Value ¶
func (n *Node) Value() *gnmi.TypedValue
Value returns the node value; nil if node is a parent node to other children