transl_utils

package
v0.0.0-...-1510907 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Writer *syslog.Writer
)

Functions

func ConvertToURI

func ConvertToURI(prefix, path *gnmipb.Path, opts ...pathutil.PathValidatorOpt) (string, error)

ConvertToURI returns translib path for a gnmi Path

func GetModels

func GetModels() []gnmipb.ModelData

Fetch the supported models.

func GnmiTranslFullPath

func GnmiTranslFullPath(prefix, path *gnmipb.Path) *gnmipb.Path

func PopulateClientPaths

func PopulateClientPaths(prefix *gnmipb.Path, paths []*gnmipb.Path, path2URI *map[*gnmipb.Path]string, addWildcardKeys bool) error

Populate the URI path corresponding GNMI paths.

func TranslProcessAction

func TranslProcessAction(uri string, payload []byte, ctx context.Context) ([]byte, error)

Action/rpc request handling.

func TranslProcessBulk

func TranslProcessBulk(delete []*gnmipb.Path, replace []*gnmipb.Update, update []*gnmipb.Update, prefix *gnmipb.Path, ctx context.Context) error

func TranslProcessDelete

func TranslProcessDelete(prefix, delPath *gnmipb.Path, ctx context.Context) error

Delete request handling.

func TranslProcessGet

func TranslProcessGet(uriPath string, op *string, ctx context.Context) (*gnmipb.TypedValue, error)

Fill the values from TransLib.

func TranslProcessReplace

func TranslProcessReplace(prefix *gnmipb.Path, entry *gnmipb.Update, ctx context.Context) error

Replace request handling.

func TranslProcessUpdate

func TranslProcessUpdate(prefix *gnmipb.Path, entry *gnmipb.Update, ctx context.Context) error

Update request handling.

Types

type DiffOptions

type DiffOptions struct {
	// RecordAll indicates if all attributes of modified GoStruct
	// should be recorded - even if the values are same.
	RecordAll bool
}

DiffOptions holds the optional parameters foi Diff API.

type DiffResults

type DiffResults struct {
	Update []*gnmi.Update
	Delete []*gnmi.Path
}

DiffResults holds updated {path, value} pairs and deleted paths resolved by the Diff API.

func Diff

func Diff(original, modified ygot.GoStruct, opts DiffOptions) (DiffResults, error)

Diff compares original and modified ygot structs; returns the changes as a DiffResults. Works with translib generated ygot structs only.

Jump to

Keyboard shortcuts

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