Documentation
¶
Index ¶
- Constants
- Variables
- func ArrMapLen(arr reflect.Value, arg []reflect.Value) (reflect.Value, error)
- func IsDateFormatValid(layout, date string) bool
- func SetNumberValue(target, newvalue reflect.Value) error
- func StrCompare(str string, arg []reflect.Value) (reflect.Value, error)
- func StrContains(str string, arg []reflect.Value) (reflect.Value, error)
- func StrCount(str string, arg []reflect.Value) (reflect.Value, error)
- func StrHasPrefix(str string, arg []reflect.Value) (reflect.Value, error)
- func StrHasSuffix(str string, arg []reflect.Value) (reflect.Value, error)
- func StrIndex(str string, arg []reflect.Value) (reflect.Value, error)
- func StrLastIndex(str string, arg []reflect.Value) (reflect.Value, error)
- func StrLen(str string, arg []reflect.Value) (reflect.Value, error)
- func StrRepeat(str string, arg []reflect.Value) (reflect.Value, error)
- func StrReplace(str string, arg []reflect.Value) (reflect.Value, error)
- func StrSplit(str string, arg []reflect.Value) (reflect.Value, error)
- func StrToLower(str string, arg []reflect.Value) (reflect.Value, error)
- func StrToUpper(str string, arg []reflect.Value) (reflect.Value, error)
- func StrTrim(str string, arg []reflect.Value) (reflect.Value, error)
- type GoValueNode
- func (node *GoValueNode) AppendValue(value []reflect.Value) (err error)
- func (node *GoValueNode) CallFunction(funcName string, args ...reflect.Value) (retval reflect.Value, err error)
- func (node *GoValueNode) ContinueWithValue(value reflect.Value, identifiedAs string) ValueNode
- func (node *GoValueNode) GetArrayType() (reflect.Type, error)
- func (node *GoValueNode) GetArrayValueAt(index int) (reflect.Value, error)
- func (node *GoValueNode) GetChildNodeByField(field string) (ValueNode, error)
- func (node *GoValueNode) GetChildNodeByIndex(index int) (ValueNode, error)
- func (node *GoValueNode) GetChildNodeBySelector(index reflect.Value) (ValueNode, error)
- func (node *GoValueNode) GetMapValueAt(index reflect.Value) (reflect.Value, error)
- func (node *GoValueNode) GetObjectTypeByField(field string) (typ reflect.Type, err error)
- func (node *GoValueNode) GetObjectValueByField(field string) (reflect.Value, error)
- func (node *GoValueNode) GetType() (reflect.Type, error)
- func (node *GoValueNode) GetValue() (reflect.Value, error)
- func (node *GoValueNode) HasParent() bool
- func (node *GoValueNode) IdentifiedAs() string
- func (node *GoValueNode) IsArray() bool
- func (node *GoValueNode) IsBool() bool
- func (node *GoValueNode) IsInteger() bool
- func (node *GoValueNode) IsMap() bool
- func (node *GoValueNode) IsObject() bool
- func (node *GoValueNode) IsReal() bool
- func (node *GoValueNode) IsString() bool
- func (node *GoValueNode) IsTime() bool
- func (node *GoValueNode) Length() (int, error)
- func (node *GoValueNode) Parent() ValueNode
- func (node *GoValueNode) SetArrayValueAt(index int, value reflect.Value) (err error)
- func (node *GoValueNode) SetMapValueAt(index, newValue reflect.Value) (err error)
- func (node *GoValueNode) SetObjectValueByField(field string, newValue reflect.Value) (err error)
- func (node *GoValueNode) Value() reflect.Value
- type JSONValueNode
- func (vn *JSONValueNode) AppendValue(value []reflect.Value) error
- func (vn *JSONValueNode) CallFunction(funcName string, args ...reflect.Value) (reflect.Value, error)
- func (vn *JSONValueNode) ContinueWithValue(value reflect.Value, identifiedAs string) ValueNode
- func (vn *JSONValueNode) GetArrayType() (reflect.Type, error)
- func (vn *JSONValueNode) GetArrayValueAt(index int) (reflect.Value, error)
- func (vn *JSONValueNode) GetChildNodeByField(field string) (ValueNode, error)
- func (vn *JSONValueNode) GetChildNodeByIndex(index int) (ValueNode, error)
- func (vn *JSONValueNode) GetChildNodeBySelector(index reflect.Value) (ValueNode, error)
- func (vn *JSONValueNode) GetMapValueAt(index reflect.Value) (reflect.Value, error)
- func (vn *JSONValueNode) GetObjectTypeByField(field string) (reflect.Type, error)
- func (vn *JSONValueNode) GetObjectValueByField(field string) (reflect.Value, error)
- func (vn *JSONValueNode) GetType() (reflect.Type, error)
- func (vn *JSONValueNode) GetValue() (reflect.Value, error)
- func (vn *JSONValueNode) HasParent() bool
- func (vn *JSONValueNode) IdentifiedAs() string
- func (vn *JSONValueNode) IsArray() bool
- func (vn *JSONValueNode) IsBool() bool
- func (vn *JSONValueNode) IsInteger() bool
- func (vn *JSONValueNode) IsMap() bool
- func (vn *JSONValueNode) IsObject() bool
- func (vn *JSONValueNode) IsReal() bool
- func (vn *JSONValueNode) IsString() bool
- func (vn *JSONValueNode) IsTime() bool
- func (vn *JSONValueNode) Length() (l int, e error)
- func (vn *JSONValueNode) Parent() ValueNode
- func (vn *JSONValueNode) SetArrayValueAt(index int, value reflect.Value) error
- func (vn *JSONValueNode) SetMapValueAt(index, newValue reflect.Value) error
- func (vn *JSONValueNode) SetObjectValueByField(field string, newValue reflect.Value) error
- func (vn *JSONValueNode) Value() reflect.Value
- type ValueNode
Constants ¶
const ( // ANSIC regex to validate ANSIC date string ANSIC = `` /* 129-byte string literal not displayed */ // UnixDate regex to validate UnixDate date string UnixDate = `` /* 133-byte string literal not displayed */ // RubyDate regex to validate RubyDate date string RubyDate = `` /* 140-byte string literal not displayed */ // RFC822 regex to validate RFC822 date string RFC822 = `^[0-9]{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]{2} [0-9]{2}:[0-9]{2} MST$` // RFC822Z regex to validate RFC822Z date string RFC822Z = `^[0-9]{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]{2} [0-9]{2}:[0-9]{2} \-?[0-9]{4}$` // RFC822 with numeric zone // RFC850 regex to validate RFC850 date string RFC850 = `` /* 160-byte string literal not displayed */ // RFC1123 regex to validate RFC1123 date string RFC1123 = `` /* 131-byte string literal not displayed */ // RFC1123Z regex to validate RFC1123Z date string RFC1123Z = `` // RFC1123 with numeric zone /* 139-byte string literal not displayed */ // RFC3339 regex to validate RFC3339 date string RFC3339 = `^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z[0-9]{2}:[0-9]{2}$` // RFC3339Nano regex to validate RFC3339Nano date string RFC3339Nano = `^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{2}Z[0-9]{2}:[0-9]{2}$` // Kitchen regex to validate Kitchen date string Kitchen = `^[0-1]?[0-9]:[0-9]{2}(AM|PM)$` // Stamp regex to validate Stamp date string Stamp = `^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]?[0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}$` // StampMilli regex to validate StampMilli date string StampMilli = `^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]?[0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}$` // StampMicro regex to validate StampMicro date string StampMicro = `^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]?[0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{6}$` // StampNano regex to validate StampNano date string StampNano = `^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]?[0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{9}$` )
Variables ¶
var ( // DateTimeLayout contains the date time layouting used by this data access layer. DateTimeLayout = time.RFC3339 )
var ( // TimeValidatorMap map from time format to their validator regex pattern TimeValidatorMap = map[string]string{ time.ANSIC: ANSIC, time.UnixDate: UnixDate, time.RubyDate: RubyDate, time.RFC822: RFC822, time.RFC822Z: RFC822Z, time.RFC850: RFC850, time.RFC1123: RFC1123, time.RFC1123Z: RFC1123Z, time.RFC3339: RFC3339, time.RFC3339Nano: RFC3339Nano, time.Kitchen: Kitchen, time.Stamp: Stamp, time.StampMilli: StampMilli, time.StampMicro: StampMicro, time.StampNano: StampNano, } )
Functions ¶
func IsDateFormatValid ¶ added in v1.8.0
IsDateFormatValid validate if the supplied date string is compatible with specified format. the format should come from standard time format (eg. time.RFC3339, time.ANSIC, time.ANSIC, time.RFC850, etc)
func SetNumberValue ¶ added in v1.6.0
SetNumberValue will assign a numeric value to a numeric target value this helper function is to ensure assignment between numerical types is happening regardless of types, int, uint or float. The rule designer should be careful as conversion of types in automatic way like this will cause lost of precision during conversion. This will be removed in the future version.
func StrCompare ¶ added in v1.6.0
StrCompare is like strings.compare() function, to be called by the ValueNode function call if the underlying data is string.
func StrContains ¶ added in v1.6.0
StrContains is like strings.Contains() function, to be called by the ValueNode function call if the underlying data is string. is like strings.compare() function, to be called by the ValueNode functioncall if the underlying data is string.
func StrCount ¶ added in v1.6.0
StrCount is like strings.Count() function, to be called by the ValueNode function call if the underlying data is string.
func StrHasPrefix ¶ added in v1.6.0
StrHasPrefix is like strings.HasPrefix() function, to be called by the ValueNode functioncall if the underlying data is string.
func StrHasSuffix ¶ added in v1.6.0
StrHasSuffix is like strings.HasSuffix() function, to be called by the ValueNode functioncall if the underlying data is string.
func StrIndex ¶ added in v1.6.0
StrIndex is like strings.Index() function, to be called by the ValueNode functioncall if the underlying data is string.
func StrLastIndex ¶ added in v1.6.0
StrLastIndex is like strings.LastIndex() function, to be called by the ValueNode functioncall if the underlying data is string.
func StrRepeat ¶ added in v1.6.0
StrRepeat is like strings.Repeat() function, to be called by the ValueNode functioncall if the underlying data is string.
func StrReplace ¶ added in v1.6.0
StrReplace is like strings.Replace() function, to be called by the ValueNode functioncall if the underlying data is string.
func StrSplit ¶ added in v1.6.0
StrSplit is like strings.Split() function, to be called by the ValueNode functioncall if the underlying data is string.
func StrToLower ¶ added in v1.6.0
StrToLower is like strings.ToLower() function, to be called by the ValueNode functioncall if the underlying data is string.
func StrToUpper ¶ added in v1.6.0
StrToUpper is like strings.ToUpper() function, to be called by the ValueNode functioncall if the underlying data is string.
Types ¶
type GoValueNode ¶ added in v1.6.0
type GoValueNode struct {
// contains filtered or unexported fields
}
GoValueNode is an implementation of ValueNode that used to traverse native golang primitives through reflect package
func (*GoValueNode) AppendValue ¶ added in v1.6.0
func (node *GoValueNode) AppendValue(value []reflect.Value) (err error)
AppendValue will append the new values into the current underlying array. will return error if argument list are not compatible with the array element type.
func (*GoValueNode) CallFunction ¶ added in v1.6.0
func (node *GoValueNode) CallFunction(funcName string, args ...reflect.Value) (retval reflect.Value, err error)
CallFunction will call a function owned by the underlying value receiver. this function will artificially create a built-in functions for constants, array and map.
func (*GoValueNode) ContinueWithValue ¶ added in v1.6.0
func (node *GoValueNode) ContinueWithValue(value reflect.Value, identifiedAs string) ValueNode
ContinueWithValue will return a nother ValueNode to wrap the specified value and treated as child of current node. The main purpose of this is for easier debugging.
func (*GoValueNode) GetArrayType ¶ added in v1.6.0
func (node *GoValueNode) GetArrayType() (reflect.Type, error)
GetArrayType to get the type of underlying value array element types.
func (*GoValueNode) GetArrayValueAt ¶ added in v1.6.0
func (node *GoValueNode) GetArrayValueAt(index int) (reflect.Value, error)
GetArrayValueAt to get the value of an array element if the current underlying value is an array
func (*GoValueNode) GetChildNodeByField ¶ added in v1.6.0
func (node *GoValueNode) GetChildNodeByField(field string) (ValueNode, error)
GetChildNodeByField will retrieve the underlying struct's field and return the ValueNode wraper.
func (*GoValueNode) GetChildNodeByIndex ¶ added in v1.6.0
func (node *GoValueNode) GetChildNodeByIndex(index int) (ValueNode, error)
GetChildNodeByIndex is similar to `GetArrayValueAt`, where this will return a ValueNode that wrap the value.
func (*GoValueNode) GetChildNodeBySelector ¶ added in v1.6.0
func (node *GoValueNode) GetChildNodeBySelector(index reflect.Value) (ValueNode, error)
GetChildNodeBySelector is similar to GetMapValueAt, it retrieve a value of map element identified by a value index as ValueNode.
func (*GoValueNode) GetMapValueAt ¶ added in v1.6.0
GetMapValueAt will retrieve a map value by the specified key argument.
func (*GoValueNode) GetObjectTypeByField ¶ added in v1.6.0
func (node *GoValueNode) GetObjectTypeByField(field string) (typ reflect.Type, err error)
GetObjectTypeByField will return underlying type of the value's field
func (*GoValueNode) GetObjectValueByField ¶ added in v1.6.0
func (node *GoValueNode) GetObjectValueByField(field string) (reflect.Value, error)
GetObjectValueByField will return underlying value's field
func (*GoValueNode) GetType ¶ added in v1.6.0
func (node *GoValueNode) GetType() (reflect.Type, error)
GetType will return the underlying value's type
func (*GoValueNode) GetValue ¶ added in v1.6.0
func (node *GoValueNode) GetValue() (reflect.Value, error)
GetValue will return the underlying reflect.Value
func (*GoValueNode) HasParent ¶ added in v1.6.0
func (node *GoValueNode) HasParent() bool
HasParent returns `true` if the current value is a field, function, map, array, slice of another value
func (*GoValueNode) IdentifiedAs ¶ added in v1.6.0
func (node *GoValueNode) IdentifiedAs() string
IdentifiedAs return the current representation of this Value Node
func (*GoValueNode) IsArray ¶ added in v1.6.0
func (node *GoValueNode) IsArray() bool
IsArray to check if the underlying value is an array or not
func (*GoValueNode) IsBool ¶ added in v1.6.0
func (node *GoValueNode) IsBool() bool
IsBool will check if the underlying value is a type of boolean.
func (*GoValueNode) IsInteger ¶ added in v1.6.0
func (node *GoValueNode) IsInteger() bool
IsInteger will check if the underlying value is a type of int, or uint
func (*GoValueNode) IsMap ¶ added in v1.6.0
func (node *GoValueNode) IsMap() bool
IsMap will validate if the underlying value is a map.
func (*GoValueNode) IsObject ¶ added in v1.6.0
func (node *GoValueNode) IsObject() bool
IsObject will check if the underlying value is a struct or pointer to a struct
func (*GoValueNode) IsReal ¶ added in v1.6.0
func (node *GoValueNode) IsReal() bool
IsReal will check if the underlying value is a type of real number, float.
func (*GoValueNode) IsString ¶ added in v1.6.0
func (node *GoValueNode) IsString() bool
IsString will check if the underlying value is a type of string
func (*GoValueNode) IsTime ¶ added in v1.6.0
func (node *GoValueNode) IsTime() bool
IsTime will check if the underlying value is a time.Time
func (*GoValueNode) Length ¶ added in v1.6.0
func (node *GoValueNode) Length() (int, error)
Length will return the length of underlying value if its an array, slice, map or string
func (*GoValueNode) Parent ¶ added in v1.6.0
func (node *GoValueNode) Parent() ValueNode
Parent returns the value node of the parent value, if this node is a field, function, map, array, slice of another value
func (*GoValueNode) SetArrayValueAt ¶ added in v1.6.0
func (node *GoValueNode) SetArrayValueAt(index int, value reflect.Value) (err error)
SetArrayValueAt will set the value of specified array index on the current underlying array value.
func (*GoValueNode) SetMapValueAt ¶ added in v1.6.0
func (node *GoValueNode) SetMapValueAt(index, newValue reflect.Value) (err error)
SetMapValueAt will set the map value for the specified key, value argument
func (*GoValueNode) SetObjectValueByField ¶ added in v1.6.0
func (node *GoValueNode) SetObjectValueByField(field string, newValue reflect.Value) (err error)
SetObjectValueByField will set the underlying value's field with new value.
func (*GoValueNode) Value ¶ added in v1.6.0
func (node *GoValueNode) Value() reflect.Value
Value returns the underlying reflect.Value
type JSONValueNode ¶ added in v1.8.0
type JSONValueNode struct {
// contains filtered or unexported fields
}
JSONValueNode will hold the json root object as the result of JSON unmarshal
func (*JSONValueNode) AppendValue ¶ added in v1.8.0
func (vn *JSONValueNode) AppendValue(value []reflect.Value) error
AppendValue will append an array of reflect.Value(s) into the end of this array/slice node. It will return error if its not an array nor slice.
func (*JSONValueNode) CallFunction ¶ added in v1.8.0
func (vn *JSONValueNode) CallFunction(funcName string, args ...reflect.Value) (reflect.Value, error)
CallFunction will always return an error, as Json data do not have any function in them.
func (*JSONValueNode) ContinueWithValue ¶ added in v1.8.0
func (vn *JSONValueNode) ContinueWithValue(value reflect.Value, identifiedAs string) ValueNode
ContinueWithValue will return a new node contains the specified value and the parent will be this value.
func (*JSONValueNode) GetArrayType ¶ added in v1.8.0
func (vn *JSONValueNode) GetArrayType() (reflect.Type, error)
GetArrayType return the content of an array. Since json array can contain any type, it will aways return type of nil.
func (*JSONValueNode) GetArrayValueAt ¶ added in v1.8.0
func (vn *JSONValueNode) GetArrayValueAt(index int) (reflect.Value, error)
GetArrayValueAt return the value of array element specified by index. It will return error if this node is not array or slice.
func (*JSONValueNode) GetChildNodeByField ¶ added in v1.8.0
func (vn *JSONValueNode) GetChildNodeByField(field string) (ValueNode, error)
GetChildNodeByField will return the field ValueNode
func (*JSONValueNode) GetChildNodeByIndex ¶ added in v1.8.0
func (vn *JSONValueNode) GetChildNodeByIndex(index int) (ValueNode, error)
GetChildNodeByIndex will return the array node of array element specified by index. It will return error if its not an array nor slice.
func (*JSONValueNode) GetChildNodeBySelector ¶ added in v1.8.0
func (vn *JSONValueNode) GetChildNodeBySelector(index reflect.Value) (ValueNode, error)
GetChildNodeBySelector get the ValueNode
func (*JSONValueNode) GetMapValueAt ¶ added in v1.8.0
GetMapValueAt get the value of this map node at specific index/selector value. In json, the index selector must be of type of string.
func (*JSONValueNode) GetObjectTypeByField ¶ added in v1.8.0
func (vn *JSONValueNode) GetObjectTypeByField(field string) (reflect.Type, error)
GetObjectTypeByField get the type of the value by specified field. Since in json any field could store any field and there are no definition of what type on any field, this function will always return value of nil
func (*JSONValueNode) GetObjectValueByField ¶ added in v1.8.0
func (vn *JSONValueNode) GetObjectValueByField(field string) (reflect.Value, error)
GetObjectValueByField get the value of this node by the specified field.
func (*JSONValueNode) GetType ¶ added in v1.8.0
func (vn *JSONValueNode) GetType() (reflect.Type, error)
GetType return the reflect.Type of the value in this node
func (*JSONValueNode) GetValue ¶ added in v1.8.0
func (vn *JSONValueNode) GetValue() (reflect.Value, error)
GetValue same as Value()
func (*JSONValueNode) HasParent ¶ added in v1.8.0
func (vn *JSONValueNode) HasParent() bool
HasParent will return true if this node has parent node, other wise return false
func (*JSONValueNode) IdentifiedAs ¶ added in v1.8.0
func (vn *JSONValueNode) IdentifiedAs() string
IdentifiedAs will return the node label
func (*JSONValueNode) IsArray ¶ added in v1.8.0
func (vn *JSONValueNode) IsArray() bool
IsArray will validate if this node's value is of kind Array or Slice
func (*JSONValueNode) IsBool ¶ added in v1.8.0
func (vn *JSONValueNode) IsBool() bool
IsBool return true if the value of this node contains a boolean.
func (*JSONValueNode) IsInteger ¶ added in v1.8.0
func (vn *JSONValueNode) IsInteger() bool
IsInteger return true if the value of this node is conform to an integer. (no floating point value).
func (*JSONValueNode) IsMap ¶ added in v1.8.0
func (vn *JSONValueNode) IsMap() bool
IsMap will validate if this node is a map.
func (*JSONValueNode) IsObject ¶ added in v1.8.0
func (vn *JSONValueNode) IsObject() bool
IsObject returns true if this node is an object or map.
func (*JSONValueNode) IsReal ¶ added in v1.8.0
func (vn *JSONValueNode) IsReal() bool
IsReal return true if the value of this node contains integer or floating point.
func (*JSONValueNode) IsString ¶ added in v1.8.0
func (vn *JSONValueNode) IsString() bool
IsString returns true if the value of this node contains a string.
func (*JSONValueNode) IsTime ¶ added in v1.8.0
func (vn *JSONValueNode) IsTime() bool
IsTime return true if the value of this node is of type string with specified DateTimeLayout
func (*JSONValueNode) Length ¶ added in v1.8.0
func (vn *JSONValueNode) Length() (l int, e error)
Length return the length of this node. It will return error if not type of string, map, array/slice or object.
func (*JSONValueNode) Parent ¶ added in v1.8.0
func (vn *JSONValueNode) Parent() ValueNode
Parent returns the parent node of this node.
func (*JSONValueNode) SetArrayValueAt ¶ added in v1.8.0
func (vn *JSONValueNode) SetArrayValueAt(index int, value reflect.Value) error
SetArrayValueAt sets this node array element specified at index with new value. User should be careful to not set element with out of bound index. It will return error if its not an array nor slice.
func (*JSONValueNode) SetMapValueAt ¶ added in v1.8.0
func (vn *JSONValueNode) SetMapValueAt(index, newValue reflect.Value) error
SetMapValueAt set the value in this map as specific index/selector value. In json, the index selector must be of type of string.
func (*JSONValueNode) SetObjectValueByField ¶ added in v1.8.0
func (vn *JSONValueNode) SetObjectValueByField(field string, newValue reflect.Value) error
SetObjectValueByField set the value in the node by specified field name.
func (*JSONValueNode) Value ¶ added in v1.8.0
func (vn *JSONValueNode) Value() reflect.Value
Value returns the reflect.Value of this node
type ValueNode ¶ added in v1.6.0
type ValueNode interface {
IdentifiedAs() string
Value() reflect.Value
HasParent() bool
Parent() ValueNode
ContinueWithValue(value reflect.Value, identifiedAs string) ValueNode
GetValue() (reflect.Value, error)
GetType() (reflect.Type, error)
IsArray() bool
GetArrayType() (reflect.Type, error)
GetArrayValueAt(index int) (reflect.Value, error)
GetChildNodeByIndex(index int) (ValueNode, error)
SetArrayValueAt(index int, value reflect.Value) error
AppendValue(value []reflect.Value) error
Length() (int, error)
IsMap() bool
GetMapValueAt(index reflect.Value) (reflect.Value, error)
SetMapValueAt(index, newValue reflect.Value) error
GetChildNodeBySelector(index reflect.Value) (ValueNode, error)
IsObject() bool
GetObjectValueByField(field string) (reflect.Value, error)
GetObjectTypeByField(field string) (reflect.Type, error)
SetObjectValueByField(field string, newValue reflect.Value) error
CallFunction(funcName string, args ...reflect.Value) (reflect.Value, error)
GetChildNodeByField(field string) (ValueNode, error)
IsTime() bool
IsInteger() bool
IsReal() bool
IsBool() bool
IsString() bool
}
ValueNode is an abstraction layer to access underlying dom style data. the node have tree kind of structure which each node are tied to an underlying data node.
func NewGoValueNode ¶ added in v1.6.0
NewGoValueNode creates new instance of ValueNode backed by golang reflection
func NewJSONValueNode ¶ added in v1.8.0
NewJSONValueNode will create a new ValueNode structure backend using data structure as provided by JSON parser.