yangschema

package
v0.29.20 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tree

type Tree struct {
	ctree.Tree
}

Tree contains a ctree.Tree that stores a copy of the YANG schema tree containing only leaf entries, such that schema paths can be referenced.

func BuildTree

func BuildTree(entries []*yang.Entry) (*Tree, error)

BuildTree maps a set of yang.Entry pointers into a ctree structure. Only leaf or leaflist values are mapped, since these are the only entities that can be referenced by XPATH expressions within a YANG schema. It returns an error if there is duplication within the set of entries. The paths that are used within the schema are represented as a slice of strings.

func (*Tree) ResolveLeafrefTarget

func (t *Tree) ResolveLeafrefTarget(path string, contextEntry *yang.Entry) (*yang.Entry, error)

ResolveLeafrefTarget takes an input path and context entry and determines the type of the leaf that is referred to by the path, such that it can be mapped to a native language type. It returns the yang.YangType that is associated with the target, and the target yang.Entry, such that the caller can map this to the relevant language type.

Jump to

Keyboard shortcuts

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