protomap

package
v0.10.13 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package protomap provides utilities that map ygen-generated protobuf messages to and from other types (e.g., gNMI Notification messages, or ygen-generated GoStructs).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PathsFromProto

func PathsFromProto(p proto.Message) (map[*gpb.Path]interface{}, error)

PathsFromProto returns, from a populated proto, a map between the YANG schema path (as specified in the yext.schemapath extension) and the value populated in the message.

func ProtoFromPaths added in v0.10.13

func ProtoFromPaths(p proto.Message, vals map[*gpb.Path]interface{}, prefix *gpb.Path) error

ProtoFromPaths takes an input ygot-generated protobuf and unmarshals the values that are specified in the map vals into it, using prefix as the prefix to any paths within the vals map. The message, p, is modified in place. The map, vals, must be keyed by the gNMI path to the field which is annotated in the ygot generated protobuf, the complete path is taken to be prefix + the key found in the map.

Types

This section is empty.

Directories

Path Synopsis
Package integration_tests performs tests against real-world schemas for protomap.
Package integration_tests performs tests against real-world schemas for protomap.

Jump to

Keyboard shortcuts

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