Documentation ¶
Index ¶
- func CreatePath(input []string) string
- func DoMapArrayKeysMatch(o interface{}, m interface{}) bool
- func GetSliceOfKeys(input KeyValue) []string
- func IndexOf(inputList []string, inputKey string) int
- func MapMatchAny(a map[string]interface{}, b map[string]interface{}) bool
- func MatchAny(compare interface{}, compareSlice []interface{}) bool
- func PathSplit(input string) []string
- func SliceIndex(i int, path []string) []string
- func SliceIndexOf(item interface{}, list []interface{}) int
- func UnorderedKeyMatch(o map[string]interface{}, m map[string]interface{}) bool
- type AddedDifference
- type ChangedDifference
- type ConsumableDifference
- type Gaussian
- type IndexDifference
- type KeySlice
- type KeyValue
- type RemovedDifference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePath ¶
CreatePath Given an array, construct it into a jmespath expression (string with . separator)
func DoMapArrayKeysMatch ¶
func DoMapArrayKeysMatch(o interface{}, m interface{}) bool
DoMapArrayKeysMatch Uses 'UnorderedKeyMatch' to return a bool for two interfaces if they're both maps
func GetSliceOfKeys ¶
GetSliceOfKeys creates a slice of keys from an object
func MapMatchAny ¶
MapMatchAny check if map exists in larger map
func MatchAny ¶
func MatchAny(compare interface{}, compareSlice []interface{}) bool
MatchAny check if an object exists anywhere in a slice
func PathSplit ¶
PathSplit Splits up jmespath format path into a slice, will ignore escaped '.' ; opposite of CreatePath
func SliceIndex ¶
SliceIndex Adds an 'index' value to the last string in the slice, used for the 'path' to handle arrays.
func SliceIndexOf ¶
func SliceIndexOf(item interface{}, list []interface{}) int
SliceIndexOf find index of item from in slice
func UnorderedKeyMatch ¶
UnorderedKeyMatch Returns a bool dependant on all 'keys' in a map matching.
Types ¶
type AddedDifference ¶
type AddedDifference struct { Key string `json:",omitempty"` Path string Value interface{} // contains filtered or unexported fields }
AddedDifference sub struct for added objects
type ChangedDifference ¶
type ChangedDifference struct { Key string `json:",omitempty"` Path string NewValue interface{} OldValue interface{} // contains filtered or unexported fields }
ChangedDifference sub struct for changed objects
type ConsumableDifference ¶
type ConsumableDifference struct { Changed []ChangedDifference `json:",omitempty"` Added []AddedDifference `json:",omitempty"` Removed []RemovedDifference `json:",omitempty"` Indexes []IndexDifference `json:",omitempty"` }
ConsumableDifference eventual return object
func (*ConsumableDifference) Read ¶
func (c *ConsumableDifference) Read(file string) error
Read helper to read file that handles bom and unmarshals for our patch
func (*ConsumableDifference) Sort ¶
func (c *ConsumableDifference) Sort() error
Sort each key in our object so marshaled object is also consistent
type Gaussian ¶
type Gaussian struct { Data interface{} // What we read into the struct Type string // Json/Yaml }
Gaussian wrapper to handle inputs
type IndexDifference ¶
type IndexDifference struct { NewIndex int OldIndex int Path string Value interface{} // contains filtered or unexported fields }
IndexDifference sub struct for list index changes
type KeySlice ¶
KeySlice map of string to slice of KeyValue
var FormattedDiff KeySlice
FormattedDiff difference visualized as object
type RemovedDifference ¶
type RemovedDifference struct { Key string `json:",omitempty"` Path string Value interface{} // contains filtered or unexported fields }
RemovedDifference sub struct for removed objects