yentry

package
v0.1.507 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GnmiPath2XPath added in v0.1.281

func GnmiPath2XPath(path *gnmi.Path, keys bool) string

GnmiPath2XPath converts a gnmi path with or without keys to a string pointer

Types

type Entry

type Entry struct {
	Log              logging.Logger
	Name             string
	Key              []string
	Parent           *Entry
	Children         map[string]*Entry
	ResourceBoundary bool
	LeafRefs         []*leafref.LeafRef
	Resources        []*gnmi.Path
}

func (*Entry) GetChildren

func (e *Entry) GetChildren() map[string]*Entry

func (*Entry) GetHierarchicalResourcesLocal added in v0.1.263

func (e *Entry) GetHierarchicalResourcesLocal(root bool, p *gnmi.Path, cp *gnmi.Path, hierPaths []*gnmi.Path) []*gnmi.Path

GetHierarchicalResourcesLocal returns the hierarchical paths of a resource 0. root is to know the first resource that is actually the root of the path 1. p is the path of the root resource 2. cp is the current path that extends to find the hierarchical resources once p is found 3. hierPaths contains the hierarchical resources

func (*Entry) GetHierarchicalResourcesRemote added in v0.1.263

func (e *Entry) GetHierarchicalResourcesRemote(p *gnmi.Path, cp *gnmi.Path, hierPaths []*gnmi.Path) []*gnmi.Path

GetHierarchicalResourcesRemote returns the hierarchical paths of a resource 1. p is the path of the root resource 2. cp is the current path that extends to find the hierarchical resources once p is found 3. hierPaths contains the hierarchical resources

func (*Entry) GetKey

func (e *Entry) GetKey() []string

func (*Entry) GetKeys added in v0.1.263

func (e *Entry) GetKeys(p *gnmi.Path) []string

GetKeys return the list of keys

func (*Entry) GetLeafRef added in v0.1.258

func (e *Entry) GetLeafRef() []*leafref.LeafRef

func (*Entry) GetLeafRefsLocal added in v0.1.263

func (e *Entry) GetLeafRefsLocal(root bool, p *gnmi.Path, cp *gnmi.Path, leafRefs []*leafref.LeafRef) []*leafref.LeafRef

Returns all leafRefs for a given resource 1. p is the path of the root resource 2. cp is the current path that extends to find the hierarchical resources once p is found 3. leafRefs contains the leafRefs of the resource

func (*Entry) GetName

func (e *Entry) GetName() string

func (*Entry) GetParent

func (e *Entry) GetParent() *Entry

func (*Entry) GetParentDependency added in v0.1.496

func (e *Entry) GetParentDependency(p, rp *gnmi.Path, lastBoundaryPathElem string) *gnmi.Path

GetParentDependency returns the parent dependency path 1. p is used to walk the yang tree, it gets decremented along the way until it reach 0 pathElem 2. rp is original root path 3. lastBoundaryPathElem is the last boundary element found along the tree

func (*Entry) GetResourceBoundary added in v0.1.236

func (e *Entry) GetResourceBoundary() bool

func (*Entry) IsPathPresent added in v0.1.275

func (e *Entry) IsPathPresent(p *gnmi.Path, rp *gnmi.Path, value string, x1 interface{}) bool

func (*Entry) Register added in v0.1.291

func (e *Entry) Register(p *gnmi.Path)

func (*Entry) ResolveLocalLeafRefs added in v0.1.264

func (e *Entry) ResolveLocalLeafRefs(p *gnmi.Path, lrp *gnmi.Path, x1 interface{}, resolution *leafref.Resolution, lridx int)

ResolveLeafRefs is a runtime function that resolves the leafrefs it recursively walks to the data and validates if the local leafref and data match up if the resolution is successfull the function returns the resolved leafrefs

func (*Entry) WithLogging added in v0.1.264

func (e *Entry) WithLogging(log logging.Logger)

type EntryInitFunc added in v0.1.264

type EntryInitFunc func(parent *Entry, opts ...EntryOption) *Entry
type Entry struct {
	Log              logging.Logger
	Name             string
	Key              []string
	Parent           Handler
	Children         map[string]Handler
	ResourceBoundary bool
	LeafRefs         []*leafref.LeafRef
}

type HandlerOption func(Handler)

func WithLogging(log logging.Logger) HandlerOption {
	return func(o Handler) {
		o.WithLogging(log)
	}
}
type Handler interface {
	WithLogging(log logging.Logger)
	GetName() string
	GetKey() []string
	GetKeys(p *gnmi.Path) []string
	GetResourceBoundary() bool
	GetHierarchicalResourcesRemote(p *gnmi.Path, cp *gnmi.Path, hierPaths []*gnmi.Path) []*gnmi.Path
	GetHierarchicalResourcesLocal(root bool, p *gnmi.Path, cp *gnmi.Path, hierPaths []*gnmi.Path) []*gnmi.Path
	GetLeafRefsLocal(root bool, p *gnmi.Path, cp *gnmi.Path, leafRefs []*leafref.LeafRef) []*leafref.LeafRef
	ResolveLocalLeafRefs(p *gnmi.Path, lrp *gnmi.Path, x interface{}, rlrs []*leafref.ResolvedLeafRef, lridx int) []*leafref.ResolvedLeafRef
	IsRemoteLeafRefPresent(p *gnmi.Path, rp *gnmi.Path, x interface{}) bool
}

type HandleInitFunc func(parent Handler, opts ...HandlerOption) Handler

type EntryOption added in v0.1.264

type EntryOption func(*Entry)

func WithLogging added in v0.1.217

func WithLogging(log logging.Logger) EntryOption

Jump to

Keyboard shortcuts

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