Documentation ¶
Index ¶
- func AddPathElem(p *gnmi.Path, e *container.Entry) *gnmi.Path
- func DeepCopyConfigPath(in *gnmi.Path) *gnmi.Path
- type HeInfo
- type HierResourceElements
- type Option
- type Resource
- func (r *Resource) AddChild(res *Resource)
- func (r *Resource) AddExternalLeafRef(ll, rl *gnmi.Path)
- func (r *Resource) AddLocalLeafRef(ll, rl *gnmi.Path)
- func (r *Resource) AssignFileName(prefix, suffix string)
- func (r *Resource) CloseFile() error
- func (r *Resource) CreateFile(dir, subdir1, subdir2 string) (err error)
- func (r *Resource) GetAbsoluteGnmiActualResourcePath() *gnmi.Path
- func (r *Resource) GetAbsoluteGnmiPath() *gnmi.Path
- func (r *Resource) GetAbsoluteLevel() int
- func (r *Resource) GetAbsoluteName() string
- func (r *Resource) GetAbsoluteXPath() *string
- func (r *Resource) GetAbsoluteXPathWithoutKey() *string
- func (r *Resource) GetActualGnmiFullPathWithKeys() *gnmi.Path
- func (r *Resource) GetActualSubResources() []*gnmi.Path
- func (r *Resource) GetChildren() []*Resource
- func (r *Resource) GetExcludeRelativeXPath() []string
- func (r *Resource) GetExternalLeafRef() []*parser.LeafRefGnmi
- func (r *Resource) GetHierResourceElement() *HierResourceElements
- func (r *Resource) GetHierResourceElements() *HierResourceElements
- func (r *Resource) GetHierarchicalElements() []*HeInfo
- func (r *Resource) GetInternalHierarchicalPaths() []*gnmi.Path
- func (r *Resource) GetLocalLeafRef() []*parser.LeafRefGnmi
- func (r *Resource) GetModule() string
- func (r *Resource) GetParent() *Resource
- func (r *Resource) GetParentPath() *gnmi.Path
- func (r *Resource) GetPath() *gnmi.Path
- func (r *Resource) GetRelativeGnmiActualResourcePath() *gnmi.Path
- func (r *Resource) GetRelativeGnmiPath() *gnmi.Path
- func (r *Resource) GetRelativeXPath() *string
- func (r *Resource) GetResourceNameWithPrefix(prefix string) string
- func (r *Resource) GetResourcePath() *gnmi.Path
- func (r *Resource) GetRootContainerEntry() *container.Entry
- func (r *Resource) GetSubResources() []*gnmi.Path
- func (r *Resource) ResourceLastElement() string
- func (r *Resource) SetRootContainerEntry(e *container.Entry)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HierResourceElements ¶ added in v0.1.177
type HierResourceElements struct {
Elems map[string]interface{}
}
func NewHierResourceElements ¶ added in v0.1.177
func NewHierResourceElements() *HierResourceElements
func (*HierResourceElements) AddHierResourceElement ¶ added in v0.1.177
func (h *HierResourceElements) AddHierResourceElement(path string)
builds a hierarchical map[string]map[string]nil element
func (*HierResourceElements) GetHierResourceElements ¶ added in v0.1.177
func (h *HierResourceElements) GetHierResourceElements() map[string]interface{}
builds a hierarchical map[string]map[string]nil element
type Option ¶
type Option func(g *Resource)
Option can be used to manipulate Options.
func WithExclude ¶
func WithModule ¶ added in v0.1.129
func WithParent ¶ added in v0.1.372
func WithParentPath ¶ added in v0.1.372
func WithSubResources ¶ added in v0.1.184
type Resource ¶
type Resource struct { Module string // Yang Module name of the resource Path *gnmi.Path // relative path from the resource; the absolute path is assembled using the resurce hierarchy with Parent ActualPath *gnmi.Path // ActualPath is a relative path from the resource with the actual key information; the absolute path is assembled using the resurce hierarchy with Parent Parent *Resource // resource dependency ParentPath *gnmi.Path // the full path of the parent Children []*Resource // the children of the resource Excludes []*gnmi.Path // relative from the the resource FileName string // the filename the resource is using to render out the config ResFile *os.File // the file reference for writing the resource file RootContainerEntry *container.Entry // this is the root element which is used to reference the hierarchical resource information Container *container.Container // root container of the resource LastContainerPtr *container.Container // pointer to the last container we process ContainerList []*container.Container // List of all containers within the resource ContainerLevel int // the current container Level when processing the yang entries ContainerLevelKeys map[int][]*container.Container // the current container Level key list LocalLeafRefs []*parser.LeafRefGnmi ExternalLeafRefs []*parser.LeafRefGnmi HierResourceElements *HierResourceElements // this defines the hierarchical elements the resource is dependent upon (map[string]interface -> map[string]map[string]map[string]interface{}) SubResources []*gnmi.Path // for the fine grain reosurce allocation we sometimes see we need subresources: e.g. ipam has rir and instance within the parent // contains filtered or unexported fields }
func NewResource ¶
func (*Resource) AddExternalLeafRef ¶
func (*Resource) AddLocalLeafRef ¶
func (*Resource) AssignFileName ¶
func (*Resource) CreateFile ¶
func (*Resource) GetAbsoluteGnmiActualResourcePath ¶
root resource have an additional entry in the path which is inconsistent with hierarchical resources to provide consistency we introduced this method to provide a consistent result for paths used mainly for leafrefs for now
func (*Resource) GetAbsoluteGnmiPath ¶
func (*Resource) GetAbsoluteLevel ¶
func (*Resource) GetAbsoluteName ¶
func (*Resource) GetAbsoluteXPath ¶
func (*Resource) GetAbsoluteXPathWithoutKey ¶
func (*Resource) GetActualGnmiFullPathWithKeys ¶ added in v0.1.169
func (*Resource) GetActualSubResources ¶ added in v0.1.185
GetActualSubResources contaians the full path of all subresources the first pathElement is a Dummy but is used in the structs so we retain it inn the response
func (*Resource) GetChildren ¶ added in v0.1.372
func (*Resource) GetExcludeRelativeXPath ¶
func (*Resource) GetExternalLeafRef ¶
func (r *Resource) GetExternalLeafRef() []*parser.LeafRefGnmi
func (*Resource) GetHierResourceElement ¶ added in v0.1.180
func (r *Resource) GetHierResourceElement() *HierResourceElements
GetHierResourceElement return the hierarchical resource element
func (*Resource) GetHierResourceElements ¶ added in v0.1.177
func (r *Resource) GetHierResourceElements() *HierResourceElements
func (*Resource) GetHierarchicalElements ¶
func (*Resource) GetInternalHierarchicalPaths ¶
func (*Resource) GetLocalLeafRef ¶
func (r *Resource) GetLocalLeafRef() []*parser.LeafRefGnmi
func (*Resource) GetParentPath ¶ added in v0.1.372
func (*Resource) GetPath ¶
GetPath returns the relative Path of the resource For the root resources we need to strip the first entry of the path since srl uses some prefix entry
func (*Resource) GetRelativeGnmiActualResourcePath ¶
root resource have a additional entry in the path which is inconsistent with hierarchical resources to provide consistencyw e introduced this method to provide a consistent result for paths used mainly for leafrefs for now