testcmp

package
v0.29.19 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package testcmp contains a functions that can be used alongside the Go cmp or ygot testutil packages to provide comparisons between particular gNMI or ygot data structures with more intelligence than the base cmp or proto.Equal functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GNMIUpdateComparer

func GNMIUpdateComparer(a, b *gnmipb.Update, jsonSpec *ytypes.Schema) (*gnmipb.Notification, bool, error)

GNMIUpdateComparer compares the two gNMI Update messages, a and b, supplied. It takes the a ytypes.Schema definition of a generated Go package, which provides the fields required to unmarshal IETF JSON contents. It returns a gNMI Notification which reflects a diff between a and b (if it can be calculated), a bool indicating whether a == b and any error that is encountered.

func UpdateComparer

func UpdateComparer(schemaFunc func() (*ytypes.Schema, error)) (testutil.CustomComparer, error)

UpdateComparer returns a testutil.CustomComparer map that contains a comparer that binds the GNMIUpdateComparer function to be used to compare gNMI Update messages. It takes an argument of the Schema() function within a generated Go package which contains the relevant details to unmarshal JSON within the package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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