Documentation
¶
Index ¶
- func EvaluateAddition(left, right reflect.Value) (reflect.Value, error)
- func EvaluateBitAnd(left, right reflect.Value) (reflect.Value, error)
- func EvaluateBitOr(left, right reflect.Value) (reflect.Value, error)
- func EvaluateDivision(left, right reflect.Value) (reflect.Value, error)
- func EvaluateEqual(left, right reflect.Value) (reflect.Value, error)
- func EvaluateGreaterThan(left, right reflect.Value) (reflect.Value, error)
- func EvaluateGreaterThanEqual(left, right reflect.Value) (reflect.Value, error)
- func EvaluateLesserThan(left, right reflect.Value) (reflect.Value, error)
- func EvaluateLesserThanEqual(left, right reflect.Value) (reflect.Value, error)
- func EvaluateLogicAnd(left, right reflect.Value) (reflect.Value, error)
- func EvaluateLogicOr(left, right reflect.Value) (reflect.Value, error)
- func EvaluateModulo(left, right reflect.Value) (reflect.Value, error)
- func EvaluateMultiplication(left, right reflect.Value) (reflect.Value, error)
- func EvaluateNotEqual(left, right reflect.Value) (reflect.Value, error)
- func EvaluateSubstraction(left, right reflect.Value) (reflect.Value, error)
- func GetAttributeBoolValue(obj interface{}, fieldName string) (bool, error)
- func GetAttributeFloat32Value(obj interface{}, fieldName string) (float32, error)
- func GetAttributeFloat64Value(obj interface{}, fieldName string) (float64, error)
- func GetAttributeInt8Value(obj interface{}, fieldName string) (int8, error)
- func GetAttributeInt16Value(obj interface{}, fieldName string) (int16, error)
- func GetAttributeInt32Value(obj interface{}, fieldName string) (int32, error)
- func GetAttributeInt64Value(obj interface{}, fieldName string) (int64, error)
- func GetAttributeIntValue(obj interface{}, fieldName string) (int, error)
- func GetAttributeInterface(obj interface{}, fieldName string) (interface{}, error)
- func GetAttributeList(obj interface{}) ([]string, error)
- func GetAttributeStringValue(obj interface{}, fieldName string) (string, error)
- func GetAttributeTimeValue(obj interface{}, fieldName string) (time.Time, error)
- func GetAttributeType(obj interface{}, fieldName string) (reflect.Type, error)
- func GetAttributeUInt8Value(obj interface{}, fieldName string) (uint8, error)
- func GetAttributeUInt16Value(obj interface{}, fieldName string) (uint16, error)
- func GetAttributeUInt32Value(obj interface{}, fieldName string) (uint32, error)
- func GetAttributeUInt64Value(obj interface{}, fieldName string) (uint64, error)
- func GetAttributeUIntValue(obj interface{}, fieldName string) (uint, error)
- func GetAttributeValue(obj interface{}, fieldName string) (reflect.Value, error)
- func GetBaseKind(val reflect.Value) reflect.Kind
- func GetFunctionList(obj interface{}) ([]string, error)
- func GetFunctionParameterTypes(obj interface{}, methodName string) ([]reflect.Type, error)
- func GetFunctionReturnTypes(obj interface{}, methodName string) ([]reflect.Type, error)
- func InvokeFunction(obj interface{}, methodName string, param []interface{}) ([]interface{}, error)
- func IsAttributeArray(obj interface{}, fieldName string) (bool, error)
- func IsAttributeMap(obj interface{}, fieldName string) (bool, error)
- func IsAttributeNilOrZero(obj interface{}, fieldName string) (bool, error)
- func IsStruct(obj interface{}) bool
- func IsValidField(obj interface{}, fieldName string) bool
- func SetAttributeBoolValue(obj interface{}, fieldName string, newValue bool) error
- func SetAttributeFloat32Value(obj interface{}, fieldName string, newValue float32) error
- func SetAttributeFloat64Value(obj interface{}, fieldName string, newValue float64) error
- func SetAttributeInt8Value(obj interface{}, fieldName string, newValue int8) error
- func SetAttributeInt16Value(obj interface{}, fieldName string, newValue int16) error
- func SetAttributeInt32Value(obj interface{}, fieldName string, newValue int32) error
- func SetAttributeInt64Value(obj interface{}, fieldName string, newValue int64) error
- func SetAttributeIntValue(obj interface{}, fieldName string, newValue int) error
- func SetAttributeInterface(obj interface{}, fieldName string, value interface{}) error
- func SetAttributeStringValue(obj interface{}, fieldName string, newValue string) error
- func SetAttributeTimeValue(obj interface{}, fieldName string, newValue time.Time) error
- func SetAttributeUInt8Value(obj interface{}, fieldName string, newValue uint8) error
- func SetAttributeUInt16Value(obj interface{}, fieldName string, newValue uint16) error
- func SetAttributeUInt32Value(obj interface{}, fieldName string, newValue uint32) error
- func SetAttributeUInt64Value(obj interface{}, fieldName string, newValue uint64) error
- func SetAttributeUIntValue(obj interface{}, fieldName string, newValue uint) error
- func SetAttributeValue(obj interface{}, fieldName string, value reflect.Value) error
- func ValueToInterface(v reflect.Value) interface{}
- type BytesResource
- type FileResource
- type ReaderResource
- type Resource
- type URLResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateAddition ¶ added in v1.2.1
EvaluateAddition will evaluate addition operation over two value
func EvaluateBitAnd ¶ added in v1.2.1
EvaluateBitAnd will evaluate Bitwise And operation over two value
func EvaluateBitOr ¶ added in v1.2.1
EvaluateBitOr will evaluate Bitwise Or operation over two value
func EvaluateDivision ¶ added in v1.2.1
EvaluateDivision will evaluate division operation over two value
func EvaluateEqual ¶ added in v1.2.1
EvaluateEqual will evaluate Equal operation over two value
func EvaluateGreaterThan ¶ added in v1.2.1
EvaluateGreaterThan will evaluate GreaterThan operation over two value
func EvaluateGreaterThanEqual ¶ added in v1.2.1
EvaluateGreaterThanEqual will evaluate GreaterThanEqual operation over two value
func EvaluateLesserThan ¶ added in v1.2.1
EvaluateLesserThan will evaluate LesserThan operation over two value
func EvaluateLesserThanEqual ¶ added in v1.2.1
EvaluateLesserThanEqual will evaluate LesserThanEqual operation over two value
func EvaluateLogicAnd ¶ added in v1.2.1
EvaluateLogicAnd will evaluate LogicalAnd operation over two value
func EvaluateLogicOr ¶ added in v1.2.1
EvaluateLogicOr will evaluate LogicalOr operation over two value
func EvaluateModulo ¶ added in v1.2.1
EvaluateModulo will evaluate modulo operation over two value
func EvaluateMultiplication ¶ added in v1.2.1
EvaluateMultiplication will evaluate multiplication operation over two value
func EvaluateNotEqual ¶ added in v1.2.1
EvaluateNotEqual will evaluate NotEqual operation over two value
func EvaluateSubstraction ¶ added in v1.2.1
EvaluateSubstraction will evaluate substraction operation over two value
func GetAttributeBoolValue ¶
GetAttributeBoolValue will try to obtain member variable's bool value
func GetAttributeFloat32Value ¶
GetAttributeFloat32Value will try to obtain member variable's float32 value
func GetAttributeFloat64Value ¶
GetAttributeFloat64Value will try to obtain member variable's float64 value
func GetAttributeInt8Value ¶
GetAttributeInt8Value will try to obtain member variable's int8 value
func GetAttributeInt16Value ¶
GetAttributeInt16Value will try to obtain member variable's int16 value
func GetAttributeInt32Value ¶
GetAttributeInt32Value will try to obtain member variable's int32 value
func GetAttributeInt64Value ¶
GetAttributeInt64Value will try to obtain member variable's int64 value
func GetAttributeIntValue ¶
GetAttributeIntValue will try to obtain member variable's int value
func GetAttributeInterface ¶
GetAttributeInterface will retrieve a members variable value as usable interface.
func GetAttributeList ¶
GetAttributeList will populate list of struct's public member variable.
func GetAttributeStringValue ¶
GetAttributeStringValue will try to obtain member variable's string value
func GetAttributeTimeValue ¶
GetAttributeTimeValue will try to obtain member variable's time.Time value
func GetAttributeType ¶
GetAttributeType will return the type of a specific member variable
func GetAttributeUInt8Value ¶
GetAttributeUInt8Value will try to obtain member variable's uint8 value
func GetAttributeUInt16Value ¶
GetAttributeUInt16Value will try to obtain member variable's uint16 value
func GetAttributeUInt32Value ¶
GetAttributeUInt32Value will try to obtain member variable's uint32 value
func GetAttributeUInt64Value ¶
GetAttributeUInt64Value will try to obtain member variable's uint64 value
func GetAttributeUIntValue ¶
GetAttributeUIntValue will try to obtain member variable's uint value
func GetAttributeValue ¶
GetAttributeValue will retrieve a members variable value.
func GetBaseKind ¶
GetBaseKind will try to obtain base obtainable kind of a value, so we know what method to call val.Int(), val.Uint(), etc.
func GetFunctionList ¶
GetFunctionList get list of functions in a struct instance
func GetFunctionParameterTypes ¶
GetFunctionParameterTypes get list of parameter types of specific function in a struct instance
func GetFunctionReturnTypes ¶
GetFunctionReturnTypes get list of return types of specific function in a struct instance
func InvokeFunction ¶
InvokeFunction invokes a specific function in a struct instance, using parameters array
func IsAttributeArray ¶
IsAttributeArray validate if a member variable is an array or a slice.
func IsAttributeMap ¶
IsAttributeMap validate if a member variable is a map.
func IsAttributeNilOrZero ¶
IsAttributeNilOrZero validate if a member variable is nil or zero.
func IsStruct ¶
func IsStruct(obj interface{}) bool
IsStruct validates if an instance is struct or pointer to struct
func IsValidField ¶
IsValidField validates if an instance struct have a field with such name
func SetAttributeBoolValue ¶
SetAttributeBoolValue will try to set member variable's bool value
func SetAttributeFloat32Value ¶
SetAttributeFloat32Value will try to set member variable's float32 value
func SetAttributeFloat64Value ¶
SetAttributeFloat64Value will try to set member variable's float64 value
func SetAttributeInt8Value ¶
SetAttributeInt8Value will try to set member variable's int8 value
func SetAttributeInt16Value ¶
SetAttributeInt16Value will try to set member variable's int16 value
func SetAttributeInt32Value ¶
SetAttributeInt32Value will try to set member variable's int32 value
func SetAttributeInt64Value ¶
SetAttributeInt64Value will try to set member variable's int64 value
func SetAttributeIntValue ¶
SetAttributeIntValue will try to set member variable's int value
func SetAttributeInterface ¶
SetAttributeInterface will try to set a member variable value with a value from an interface
func SetAttributeStringValue ¶
SetAttributeStringValue will try to set member variable's string value
func SetAttributeTimeValue ¶
SetAttributeTimeValue will try to set member variable's time.Time value
func SetAttributeUInt8Value ¶
SetAttributeUInt8Value will try to set member variable's uint8 value
func SetAttributeUInt16Value ¶
SetAttributeUInt16Value will try to set member variable's uint16 value
func SetAttributeUInt32Value ¶
SetAttributeUInt32Value will try to set member variable's uint32 value
func SetAttributeUInt64Value ¶
SetAttributeUInt64Value will try to set member variable's uint64 value
func SetAttributeUIntValue ¶
SetAttributeUIntValue will try to set member variable's uint value
func SetAttributeValue ¶
SetAttributeValue will try to set a member variable value with a new one.
func ValueToInterface ¶
ValueToInterface will try to obtain an interface to a speciffic value. it will detect the value's kind.
Types ¶
type BytesResource ¶
type BytesResource struct {
Bytes []byte
}
BytesResource is a struct that will hold the byte array data
func (*BytesResource) Load ¶
func (res *BytesResource) Load() ([]byte, error)
Load will load the resource into byte array.
func (*BytesResource) String ¶
func (res *BytesResource) String() string
String will state the resource byte array.
type FileResource ¶
FileResource is a struct that will hold the file path and readed data bytes.
func (*FileResource) Load ¶
func (res *FileResource) Load() ([]byte, error)
Load will load the resource into byte array. The load byte array will be cached by the FileResource. So Calling Load multiple time will only load the file once on the first call. If you wish to reload the file, simply create new instance using NewFileResource function.
func (*FileResource) String ¶
func (res *FileResource) String() string
String will state the resource file path.
type ReaderResource ¶
ReaderResource is a struct that will hold the reader instance.
func (*ReaderResource) Load ¶
func (res *ReaderResource) Load() ([]byte, error)
Load will load the resource into byte array.
func (*ReaderResource) String ¶
func (res *ReaderResource) String() string
String will state the resource source.
type Resource ¶
Resource should be implemented by any resource model so it can be loaded and parsed by the grule parser.
func NewBytesResource ¶
NewBytesResource will create a new Resource using a byte array.
func NewFileResource ¶
NewFileResource will create a new Resource using a file located in path.
func NewReaderResource ¶
NewReaderResource will create a new Resource using a common reader.
func NewURLResource ¶
NewURLResource will create a new Resource using a resource as located in the url
type URLResource ¶
URLResource is a struct that will hold the byte array data and URL source
func (*URLResource) Load ¶
func (res *URLResource) Load() ([]byte, error)
Load will load the resource into byte array. This resource will cache the obtained result byte arrays. So calling this function multiple times only call the URL once at the first time. If you want to refresh the load, you simply create a new instance of URLResource using NewURLResource
func (*URLResource) String ¶
func (res *URLResource) String() string
String will state the resource url.