Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasNilDifference ¶
func HasNilDifference(a, b interface{}) bool
HasNilDifference returns true if the supplied subjects' nilness is different
func IsNil ¶ added in v0.2.1
func IsNil(i interface{}) bool
IsNil checks the passed interface argument for Nil value. For interfaces, only 'i==nil' check is not sufficient. https://tour.golang.org/methods/12 More details: https://mangatmodi.medium.com/go-check-nil-interface-the-right-way-d142776edef1
func MapStringStringPEqual ¶
MapStringStringPEqual returns true if the supplied maps are equal
func SliceStringPEqual ¶
SliceStringPEqual returns true if the supplied slices of string pointers have equal values regardless of order.
Types ¶
type Delta ¶
type Delta struct { // Differences is a slice of *ackcompare.Difference structs representing // differences in values of two resources under comparison Differences []*Difference }
Delta represents differences between two AWSResources. The underlying types of the two supplied AWSResources should be the same. In other words, the Delta() method should be called with the same concrete implementing AWSResource type
func NewDelta ¶
func NewDelta() *Delta
NewDelta returns a new Delta struct used to compare two resources.
func (*Delta) DifferentAt ¶
DifferentAt returns whether there is a difference at the supplied JSONPath expression in the resources under comparison
type Difference ¶
type Difference struct { // Path is the field path to the detected difference between resources // under comparison Path Path // A is the value of the first resource under comparison at the Path A interface{} // B is the value of the first resource under comparison at the Path B interface{} }
Difference contains the difference in values for a specified field path into two compared resources.
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path provides a JSONPath-like struct and field-member "route" to a particular field within a compared struct. Path implements json.Marshaler interface.
func NewPath ¶
NewPath returns a new Path struct pointer from a dotted-notation string, e.g. "Author.Name"
func (Path) Contains ¶
Contains returns true if the supplied string, delimited on ".", matches p.parts up to the length of the supplied string.
e.g. if the Path p represents "A.B": subject "A" -> true subject "A.B" -> true subject "A.B.C" -> false subject "B" -> false subject "A.C" -> false
func (Path) MarshalJSON ¶ added in v0.2.1
MarshalJSON returns the JSON encoding of a Path object.