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 ¶
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.