path

package
Version: v0.0.0-...-aed1ee4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package path provides utility functions to convert a given gnmi.Path into index strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompletePath

func CompletePath(prefix, path *gpb.Path) ([]string, error)

CompletePath joins provided prefix and subscription paths. Also, verifies whether origin is set properly according to: https://github.com/openconfig/reference/blob/master/rpc/gnmi/mixed-schema.md Note that this function doesn't add "openconfig" default origin if neither prefix nor path specifies the origin. Also, target field isn't prepended in the returned path.

func ToStrings

func ToStrings(p *gpb.Path, prefix bool) []string

ToStrings converts gnmi.Path to index strings. When index strings are generated, gnmi.Path will be irreversibly lost. Index strings will be built by using name field in gnmi.PathElem. If gnmi.PathElem has key field, values will be included in alphabetical order of the keys. E.g. <target>/<origin>/a/b[b:d, a:c]/e will be returned as <target>/<origin>/a/b/c/d/e If prefix parameter is set to true, <target> and <origin> fields of the gnmi.Path will be prepended in the index strings unless they are empty string. gnmi.Path.Element field is deprecated, but being gracefully handled by this function in the absence of gnmi.Path.Elem.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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