Documentation
¶
Index ¶
Constants ¶
const MissingValue = "_*_NoT_PReSeNT_*_"
const Separator = "|"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComparableKind ¶
type ComparableKind int
ComparableKind is used to avoid trying to compare uncomparable types like map[string]interface{} and []interface{}
const ( Normal ComparableKind = iota MSI AI )
type D ¶
D is the type implemented by our Deltizer functions.
func (D) ApplyDelta ¶
ApplyDelta applies a delta to a pointer to a base object Only fields in the delta that match the base object are modified
func (D) CreateDelta ¶
CreateDelta takes two structs, which must be of the same type, and constructs a Delta object from them using reflection.
type Delta ¶
type Delta map[string]interface{}
Delta is a map of extended field names to values. Basically, it represents a possibly-nested struct as a flat list of key/value pairs, where the keys are a dotted name as you might see it in the source code: Foo.Buzz, for example. https://play.golang.org/p/1zkXshcT4d shows how it works.
type Deltizer ¶
type Deltizer interface {
// MakeDelta takes the field name and its value and returns
// a Delta map of all the values contained within the field
// at the appropriate level of granularity
MakeDelta(delt Delta, name string, value interface{})
// ApplyDelta takes a pointer to a field (from reflect)
// plus the name of the particular item and its value
// It expects that the field will be modified in place.
ApplyDelta(field *reflect.Value, name string, value interface{})
}
Deltizer is the interface that must be implemented in order to use custom fields with the delta generator.