value

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 52

Documentation

Overview

Package value provides utility functions for working with gNMI TypedValue messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(a, b *pb.TypedValue) bool

Equal returns true if the values in a and b are the same. This method handles only the primitive types and ScalarArrays and returns false for all other types.

func FromScalar

func FromScalar(i interface{}) (*pb.TypedValue, error)

FromScalar will convert common scalar types to their TypedValue equivalent. It will return an error if the type cannot be mapped to a scalar value.

func ToScalar

func ToScalar(tv *pb.TypedValue) (interface{}, error)

ToScalar will convert TypedValue scalar types to a Go native type. It will return an error if the TypedValue does not contain a scalar type.

Types

type DeprecatedScalar

type DeprecatedScalar struct {
	Message string
	Value   interface{}
}

DeprecatedScalar is a scalar wrapper for communicating our desire to remove this encoding from gNMI support.

Jump to

Keyboard shortcuts

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