gnmi

package
v0.0.0-...-ad9c0bf Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChildNode

func GetChildNode(node map[string]interface{}, schema *yang.Entry, elem *pb.PathElem, createIfNotExist bool) (interface{}, *yang.Entry)

GetChildNode gets a node's child with corresponding schema specified by path element. If not found and createIfNotExist is set as true, an empty node is created and returned.

func GetKeyedListEntry

func GetKeyedListEntry(node map[string]interface{}, elem *pb.PathElem, createIfNotExist bool) map[string]interface{}

GetKeyedListEntry finds the keyed list entry in node by the name and key of path elem. If entry is not found and createIfNotExist is true, an empty entry will be created (the list will be created if necessary).

Types

type GoStructEnumData

type GoStructEnumData map[string]map[int64]ygot.EnumDefinition

GoStructEnumData is the data type to maintain GoStruct enum type.

type JSONUnmarshaler

type JSONUnmarshaler func([]byte, ygot.GoStruct, ...ytypes.UnmarshalOpt) error

JSONUnmarshaler is the signature of the Unmarshal() function in the GoStruct code generated by openconfig ygot library.

type Model

type Model struct {
	ModelData       []*pb.ModelData
	StructRootType  reflect.Type
	SchemaTreeRoot  *yang.Entry
	JSONUnmarshaler JSONUnmarshaler
	EnumData        GoStructEnumData
}

Model contains the model data and GoStruct information for the device to config.

func NewModel

NewModel returns an instance of Model struct.

func (*Model) NewConfigStruct

func (m *Model) NewConfigStruct(jsonConfig []byte) (ygot.ValidatedGoStruct, error)

NewConfigStruct creates a ValidatedGoStruct of this model from jsonConfig. If jsonConfig is nil, creates an empty GoStruct.

func (*Model) SupportedModels

func (m *Model) SupportedModels() []string

SupportedModels returns a list of supported models.

Jump to

Keyboard shortcuts

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