utils

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompletePath

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

func ParsePath

func ParsePath(p string) (*sdcpb.Path, error)

ParsePath creates a sdcpb.Path out of a p string, check if the first element is prefixed by an origin, removes it from the xpath and adds it to the returned mgmt_serverPath

func SortModulesAB added in v0.0.29

func SortModulesAB(a, b string, deprioritizedModules []string) bool

SortModulesAB takes two module names and the deprioritization Module list. It figures for a and for b if they match the depriorization list and deprioritize the entry if matches. If both do not match or do match a lexicographic comparison is performed.

func ToStrings

func ToStrings(p *sdcpb.Path, prefix, nokeys 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.

func ToXPath

func ToXPath(p *sdcpb.Path, noKeys bool) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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