Help us shape the future of Go! Take the 2026 Go Developer Survey

value

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 5 Imported by: 67

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