cmp

package
v0.0.0-...-084e4ab Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message func(x, y proto.Message) bool

func And

func And(eqs ...Message) Message

func Equal

func Equal(cmpValue ...Value) Message

Equal returns a Message that compares like proto.Equal(x, y) except where value comparisons match instead.

func Or

func Or(eqs ...Message) Message

type Value

type Value func(fd pref.FieldDescriptor, x, y pref.Value) (equal bool, ok bool)

func DurationValueWithin

func DurationValueWithin(d time.Duration) Value

DurationValueWithin considers two durationpb.Duration to be equal if their durations are within d of each other.

func DurationValueWithinP

func DurationValueWithinP(p float32) Value

DurationValueWithinP considers two durationpb.Duration to be equal if their values are within p percent of each other.

func FloatValueApprox

func FloatValueApprox(fraction, margin float64) Value

FloatValueApprox compares floating point values as equal if they are within fraction or margin of each other.

func TimeValueWithin

func TimeValueWithin(d time.Duration) Value

func ValueAnd

func ValueAnd(eqs ...Value) Value

func ValueOr

func ValueOr(eqs ...Value) Value

Jump to

Keyboard shortcuts

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