resource

package
v0.1.447 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(g *Resource)

Option can be used to manipulate Options.

func WithExclude

func WithExclude(p string) Option

func WithModule added in v0.1.129

func WithModule(m string) Option

func WithXPath

func WithXPath(p string) Option

type Resource

type Resource struct {
	Parent   *Resource   // resource parent
	Children []*Resource // the children of the resource
	Module   string      // Yang Module name of the resource
	//parser               *parser.Parser                 // calls a library for parsing JSON/YANG elements
	Path *gnmi.Path // relative path from the resource; the absolute path is assembled using the resurce hierarchy with Parent

	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
	RootContainer      *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 using ygen
	ContainerLevelKeys map[int][]*container.Container // the current container Level key list
	LocalLeafRefs      []*parser.LeafRefGnmi
	ExternalLeafRefs   []*parser.LeafRefGnmi
}

func NewResource

func NewResource(parent *Resource, opts ...Option) *Resource

func (*Resource) AddChild added in v0.1.372

func (r *Resource) AddChild(res *Resource)

func (*Resource) AddExternalLeafRef

func (r *Resource) AddExternalLeafRef(ll, rl *gnmi.Path)

func (*Resource) AddLocalLeafRef

func (r *Resource) AddLocalLeafRef(ll, rl *gnmi.Path)

func (*Resource) GetAbsoluteGnmiPathFromSource added in v0.1.400

func (r *Resource) GetAbsoluteGnmiPathFromSource() *gnmi.Path

GetAbsoluteGnmiPathFromSource used for leafref validation in ygen

func (*Resource) GetAbsoluteName

func (r *Resource) GetAbsoluteName() string

func (*Resource) GetAbsolutePath added in v0.1.400

func (r *Resource) GetAbsolutePath() *gnmi.Path

func (*Resource) GetActualGnmiFullPathWithKeys added in v0.1.169

func (r *Resource) GetActualGnmiFullPathWithKeys() *gnmi.Path

GetActualGnmiFullPathWithKeys goes to the root and trickless back to get the full path with the keys; uses the containers to figure out the path used in ndd-builder

func (*Resource) GetChildResources added in v0.1.376

func (r *Resource) GetChildResources() []string

func (*Resource) GetChildren added in v0.1.372

func (r *Resource) GetChildren() []*Resource

func (*Resource) GetExcludeRelativeXPath

func (r *Resource) GetExcludeRelativeXPath() []string

func (*Resource) GetExternalLeafRef

func (r *Resource) GetExternalLeafRef() []*parser.LeafRefGnmi

func (*Resource) GetLocalLeafRef

func (r *Resource) GetLocalLeafRef() []*parser.LeafRefGnmi

func (*Resource) GetModule added in v0.1.129

func (r *Resource) GetModule() string

func (*Resource) GetParent added in v0.1.372

func (r *Resource) GetParent() *Resource

func (*Resource) GetParentPath added in v0.1.372

func (r *Resource) GetParentPath() *gnmi.Path

func (*Resource) GetParentResource added in v0.1.376

func (r *Resource) GetParentResource() string

func (*Resource) GetResourceNameWithPrefix

func (r *Resource) GetResourceNameWithPrefix(prefix string) string

GetResourceNameWithPrefix -> nddbuilder

func (*Resource) GetResourcePath added in v0.1.89

func (r *Resource) GetResourcePath() *gnmi.Path

func (*Resource) GetRootContainerEntry

func (r *Resource) GetRootContainerEntry() *container.Entry

func (*Resource) ResourceLastElement

func (r *Resource) ResourceLastElement() string

func (*Resource) SetRootContainerEntry

func (r *Resource) SetRootContainerEntry(e *container.Entry)

Jump to

Keyboard shortcuts

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