Documentation ¶
Index ¶
- func Delete(object any, name string) error
- func Get(object any, path string) any
- func GetBool(object any, path string) bool
- func GetFloat(object any, path string) float64
- func GetFromMap(object reflect.Value, path string) (any, bool)
- func GetFromSlice(object reflect.Value, path string) (any, bool)
- func GetFromStruct(object reflect.Value, path string) (any, bool)
- func GetInt(object any, path string) int
- func GetInt64(object any, path string) int64
- func GetOK(object any, path string) (any, bool)
- func GetString(object any, path string) string
- func GetWithReflection(object reflect.Value, path string) (any, bool)
- func Index(value string, maximum int) (int, error)
- func Match(object any, criteria exp.Expression) bool
- func Set(object any, name string, value any) error
- func SetAll(object any, dataset map[string]any) error
- func SetBool(object any, path string, value bool) bool
- func SetFloat(object any, path string, value float64) bool
- func SetInt(object any, path string, value int) bool
- func SetInt64(object any, path string, value int64) bool
- func SetString(object any, path string, value string) bool
- func SetToMap(object reflect.Value, path string, value any) error
- func SetToSlice(object reflect.Value, path string, value any) error
- func SetToStruct(object reflect.Value, path string, value any) error
- func SetWithReflection(object reflect.Value, path string, value any) error
- func Split(path string) (string, string)
- type BoolGetter
- type BoolGetterSetter
- type BoolSetter
- type BytesGetter
- type BytesGetterSetter
- type BytesSetter
- type ChildGetter
- type Deleter
- type Delta
- func (d *Delta) Error() error
- func (d *Delta) HasChanged() bool
- func (d *Delta) SetBool(path string, value bool)
- func (d *Delta) SetFloat(path string, value float64)
- func (d *Delta) SetInt(path string, value int)
- func (d *Delta) SetInt64(path string, value int64)
- func (d *Delta) SetString(path string, value string)
- type FloatGetter
- type FloatGetterSetter
- type FloatSetter
- type Getter
- type Int64Getter
- type Int64GetterSetter
- type Int64Setter
- type IntGetter
- type IntGetterSetter
- type IntSetter
- type Setter
- type StringGetter
- type StringGetterSetter
- type StringSetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFromMap ¶
GetFromMap uses reflection to set a value into a map
func GetFromStruct ¶
GetFromStructreturns a value from a struct. The struct MUST have "path" tags that identify how each field is to be addressed.
func GetOK ¶
GetOK returns the value of the object at the provided path. If a value does not already exist, then the OK boolean is false.
func Index ¶
Index is useful for vetting array indices. It attempts to convert the Head() token int an integer, and then check that the integer is within the designated array bounds (is greater than zero, and less than the maximum value provided to the function).
It returns the array index and an error
func Match ¶
func Match(object any, criteria exp.Expression) bool
Match returns TRUE if the provided Getter matches the provided expression
func SetAll ¶
SetAll adds every path from the dataset into the object. It returns an aggregate error containing all errors generated.
func SetToSlice ¶
SetToSlice uses reflection to set a value into a slice/array variable.
func SetToStruct ¶
SetToStruct sets a map reflection value
func SetWithReflection ¶
SetWithReflection uses a "path" to apply a value to a generic variable.
Types ¶
type BoolGetter ¶ added in v0.8.0
type BoolGetterSetter ¶ added in v0.8.0
type BoolGetterSetter interface { BoolGetter BoolSetter }
type BoolSetter ¶ added in v0.8.0
type BytesGetter ¶ added in v0.8.0
type BytesGetterSetter ¶ added in v0.8.0
type BytesGetterSetter interface { BytesGetter BytesSetter }
type BytesSetter ¶ added in v0.8.0
type ChildGetter ¶ added in v0.8.0
type Deleter ¶
Deleter interface allows other objects to make it easy to trace through their property trees, and delete values from them.
type Delta ¶ added in v0.8.0
type Delta struct {
// contains filtered or unexported fields
}
Delta tracks changes to an object
func (*Delta) Error ¶ added in v0.8.0
Error returns derp.MultiError containing all errors that have been collected
func (*Delta) HasChanged ¶ added in v0.8.0
HasChanged returns TRUE if any of the values have been changed
func (*Delta) SetFloat ¶ added in v0.8.0
SetFloat tracks changes to a float value and collects errors
type FloatGetter ¶ added in v0.8.0
type FloatGetterSetter ¶ added in v0.8.0
type FloatGetterSetter interface { FloatGetter FloatSetter }
type FloatSetter ¶ added in v0.8.0
type Getter ¶
Getter interface allows other objects to make it easy to trace through their property trees, and get values from them.
type Int64Getter ¶ added in v0.8.0
type Int64GetterSetter ¶ added in v0.8.0
type Int64GetterSetter interface { Int64Getter Int64Setter }
type Int64Setter ¶ added in v0.8.0
type IntGetterSetter ¶ added in v0.8.0
type Setter ¶
Setter interface allows other objects to make it easy to trace through their property trees, and set values into them.
type StringGetter ¶ added in v0.8.0
type StringGetterSetter ¶ added in v0.8.0
type StringGetterSetter interface { StringGetter StringSetter }