utils

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompletePath

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

func CompletePathFromString

func CompletePathFromString(s string) ([]string, error)

func CopyMap

func CopyMap(m map[string]string) map[string]string

func CopyPath

func CopyPath(p *sdcpb.Path) *sdcpb.Path

func EqualTypedValues

func EqualTypedValues(v1, v2 *sdcpb.TypedValue) bool

func FromGNMIPath

func FromGNMIPath(pre, p *gnmi.Path) *sdcpb.Path

func FromGNMITypedValue

func FromGNMITypedValue(v *gnmi.TypedValue) *sdcpb.TypedValue

func GetSchemaValue

func GetSchemaValue(updValue *sdcpb.TypedValue) (interface{}, error)

func GetValue

func GetValue(updValue *gnmi.TypedValue) (interface{}, error)

func NotificationsEqual

func NotificationsEqual(n1, n2 *sdcpb.Notification) bool

func ParseDecimal64

func ParseDecimal64(v string) (*sdcpb.Decimal64, 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 sdcpb.Path

func PathsEqual

func PathsEqual(p1, p2 *sdcpb.Path) bool

func StripPathElemPrefix

func StripPathElemPrefix(p string) (string, error)

func ToGNMIPath

func ToGNMIPath(p *sdcpb.Path) *gnmi.Path

func ToGNMITypedValue

func ToGNMITypedValue(v *sdcpb.TypedValue) *gnmi.TypedValue

func ToSchemaNotification

func ToSchemaNotification(n *gnmi.Notification) *sdcpb.Notification

func ToSchemaTypedValue

func ToSchemaTypedValue(v any) *sdcpb.TypedValue

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

func TypedValueToString

func TypedValueToString(tv *sdcpb.TypedValue) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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