pathtranslate

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package pathtranslate exports api to transform given string slice into different forms in a schema aware manner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PathTranslator

type PathTranslator struct {
	// contains filtered or unexported fields
}

PathTranslator stores the rules required to rewrite a given path as gNMI PathElem.

func NewPathTranslator

func NewPathTranslator(schemaTree []*yang.Entry) (*PathTranslator, error)

NewPathTranslator instantiates a PathTranslator with the given slice of schemas. It returns an error if any of the keyed list schemas have the similar full path.

func (*PathTranslator) PathElem

func (r *PathTranslator) PathElem(p []string) ([]*gnmipb.PathElem, error)

PathElem receives a path as string slice and generates slice of gNMI PathElem based on stored rewrite rules. It returns an error if there are less elements following the element's name in the path than the number of keys of the list.

Jump to

Keyboard shortcuts

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