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 ¶ added in v0.8.2
GetFromMap uses reflection to set a value into a map
func GetFromSlice ¶ added in v0.8.2
func GetFromStruct ¶ added in v0.8.3
GetFromStructreturns a value from a struct. The struct MUST have "path" tags that identify how each field is to be addressed.
func GetOK ¶ added in v0.8.0
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 ¶ added in v0.8.2
func Index ¶ added in v0.7.0
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 ¶ added in v0.5.0
func Match(object interface{}, criteria exp.Expression) bool
Match returns TRUE if the provided Getter matches the provided expression
func SetAll ¶ added in v0.5.0
SetAll adds every path from the dataset into the object. It returns an aggregate error containing all errors generated.
func SetToSlice ¶ added in v0.8.2
SetToSlice uses reflection to set a value into a slice/array variable.
func SetToStruct ¶ added in v0.8.3
SetToStruct sets a map reflection value
func SetWithReflection ¶ added in v0.8.2
SetWithReflection uses a "path" to apply a value to a generic variable.
Types ¶
type Deleter ¶ added in v0.3.0
Deleter interface allows other objects to make it easy to trace through their property trees, and delete values from them.