Documentation ¶
Index ¶
- Constants
- func TriggerEvents[E TriggerEvent](n *DiffNode, events []E)
- func TriggerEventsF[E Event](n *DiffNode, events []E, trigger TriggerFunc[E])
- type ActionType
- type Change
- type Changes
- type Comparator
- type CompareFunc
- type DiffNode
- type Event
- type Pair
- type Pairs
- type TriggerEvent
- type TriggerFunc
- type TypeMismatchError
Constants ¶
View Source
const (
TAG_OPTION_ID = "id"
)
Variables ¶
This section is empty.
Functions ¶
func TriggerEvents ¶
func TriggerEvents[E TriggerEvent](n *DiffNode, events []E)
TriggerEvents calls Trigger function of each detected event.
func TriggerEventsF ¶
func TriggerEventsF[E Event](n *DiffNode, events []E, trigger TriggerFunc[E])
TriggerEventsF calls trigger function for each detected event.
Types ¶
type ActionType ¶
type ActionType string
const ( UNKNOWN ActionType = "" NONE ActionType = "none" CREATE ActionType = "create" DELETE ActionType = "delete" MODIFY ActionType = "modify" )
type Change ¶
type Changes ¶
type Changes []Change
func ConflictingChanges ¶
ConflictingChanges returns changes that are either excluded from all given events or have a conflicting actions (but their paths match).
func MatchingChanges ¶
MatchingChanges returns changes that match (trigger) given events.
type Comparator ¶
type Comparator struct { Tag string ExtraNameTags []string RespectSliceOrder bool // Compares slices by index IgnoreEmptyChanges bool // Ignore leafs with "nil -> nil" value PopulateStructNodes bool // By default, before and after values are set only for leafs }
func NewComparator ¶
func NewComparator() *Comparator
func (*Comparator) Compare ¶
func (c *Comparator) Compare(a, b interface{}) (*DiffNode, error)
Compare compares the given values and returns a comparison tree.
type DiffNode ¶
type DiffNode struct {
// contains filtered or unexported fields
}
func Compare ¶
Compare initializes default comparator, compares given values and returns a comparison tree.
func NewNilNode ¶
func NewNilNode() *DiffNode
func (*DiffNode) ToYamlDiff ¶
ToYamlDiff returns only differences of the comparison in YAML like format.
type Event ¶
type Event interface { Action() ActionType // Affected action Paths() []string // Affected paths }
type TriggerEvent ¶
type TriggerFunc ¶
type TypeMismatchError ¶
type TypeMismatchError struct {
// contains filtered or unexported fields
}
TypeMismatchError represents a type mismatch error when comparing two values of different types.
func NewTypeMismatchError ¶
func NewTypeMismatchError(aKind, bKind reflect.Kind) *TypeMismatchError
func (*TypeMismatchError) Error ¶
func (e *TypeMismatchError) Error() string
Click to show internal directories.
Click to hide internal directories.