Documentation ¶
Index ¶
- func Delete(object interface{}, name string) error
- func Get(object interface{}, path string) interface{}
- func GetFromMap(object reflect.Value, path string) (interface{}, bool)
- func GetFromSlice(object reflect.Value, path string) (interface{}, bool)
- func GetFromStruct(object reflect.Value, path string) (interface{}, bool)
- func GetOK(object interface{}, path string) (interface{}, bool)
- func GetWithReflection(object reflect.Value, path string) (interface{}, bool)
- func Index(value string, maximum int) (int, error)
- func Match(object interface{}, criteria exp.Expression) bool
- func Set(object interface{}, name string, value interface{}) error
- func SetAll(object interface{}, dataset map[string]interface{}) error
- func SetToMap(object reflect.Value, path string, value interface{}) error
- func SetToSlice(object reflect.Value, path string, value interface{}) error
- func SetToStruct(object reflect.Value, path string, value interface{}) error
- func SetWithReflection(object reflect.Value, path string, value interface{}) error
- func Split(path string) (string, string)
- type Deleter
- type Getter
- type Setter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(object interface{}, path string) interface{}
Get tries to return the value of the object at this path.
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 GetWithReflection ¶
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 interface{}, 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 Deleter ¶
Deleter interface allows other objects to make it easy to trace through their property trees, and delete values from them.