dvevaluation

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

********************************************************************** MicroCore Copyright 2020 - 2022 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

********************************************************************** MicroCore Copyright 2020 - 2022 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

********************************************************************** MicroCore Copyright 2020 - 2021 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

********************************************************************** MicroCore Copyright 2020 - 2022 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

********************************************************************** MicroCore Copyright 2020 - 2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

Index

Constants

View Source
const (
	UPDATE_MODE_REPLACE = iota
	UPDATE_MODE_APPEND
	UPDATE_MODE_ADD_BY_KEYS
	UPDATE_MODE_MERGE
	UPDATE_MODE_MERGE_MIN
	UPDATE_MODE_MERGE_MAX
	UPDATE_MODE_IGNORE
)
View Source
const (
	COMPARE_NOT = iota
	COMPARE_AS_NUMBERS
	COMPARE_AS_INTEGERS
	COMPARE_AS_STRINGS
)
View Source
const (
	BooleanFalse = "false"
	BooleanTrue  = "true"
)
View Source
const (
	ConversionOptionJSLike     = 0
	ConversionOptionSimpleLike = 1
	ConversionOptionJsonLike   = 2
)
View Source
const (
	FUNCTION_KIND_ARROW = iota
	FUNCTION_KIND_NORMAL
)
View Source
const (
	FIELD_UNDEFINED = iota
	FIELD_NULL
	FIELD_NUMBER
	FIELD_BOOLEAN
	FIELD_STRING
	FIELD_OBJECT
	FIELD_ARRAY
	FIELD_FUNCTION
)
View Source
const (
	EXPRESSION_RESOLVER_CACHE = 1 << iota
)
View Source
const LENGTH_PROPERTY = "length"
View Source
const MapKeySeparator = "~^~!~"
View Source
const MaxInt = int64(^uint(0) >> 1)
View Source
const (
	TransformUpperCase = 1
)

Variables

View Source
var CalculatorPostUnaryMap = map[string]dvgrammar.UnaryVisitor{
	"++": PostPlusPlusOperator,
	"--": PostMinusMinusOperator,
}
View Source
var CalculatorRules = &dvgrammar.GrammarRuleDefinitions{
	Visitors:          CalculatorOperators,
	BracketVisitor:    BracketProcessors,
	LanguageOperator:  LanguageOperatorMap,
	DataGetter:        CalculatorDataGetter,
	EvaluateOptions:   0,
	UnaryPreVisitors:  CalculatorUnaryMap,
	UnaryPostVisitors: CalculatorPostUnaryMap,
}
View Source
var GlobalFunctionPool = make(map[string]interface{})
View Source
var GlobalFunctionPrototype = NewObject(GlobalFunctionPool)
View Source
var LanguageOperatorMap = map[string]dvgrammar.LanguageOperatorVisitor{
	"return":   ReturnOperator,
	"break":    BreakOperator,
	"continue": ContinueOperator,
	"=>":       ArrowFunctionOperator,
	"for":      ForCycleOperator,
	"if":       IfClauseOperator,
	"delete":   DeleteOperator,
}
View Source
var LogicalRules = &dvgrammar.GrammarRuleDefinitions{
	BaseGrammar:      dvgrammar.LogicalGrammarBaseDefinition,
	Visitors:         LogicalOperators,
	DataGetter:       LogicalDataGetter,
	EvaluateOptions:  0,
	UnaryPreVisitors: LogicalUnaryMap,
}
View Source
var LogicalUnaryMap = map[string]dvgrammar.UnaryVisitor{
	"!": LogicalNotOperator,
}
View Source
var ProcessorFunctions = map[string]ProcessorFunction{
	"find": ProcessorFind,
}

Functions

func AddListToGlobalFunctionPool added in v1.0.2

func AddListToGlobalFunctionPool(properties []*DvVariable)

func AddToGlobalFunctionPool

func AddToGlobalFunctionPool(properties map[string]interface{})

func AnyCompareAnyWithTypes

func AnyCompareAnyWithTypes(kind1 int, value1 interface{}, kind2 int, value2 interface{}) int

returns 1-greater, -1-lesser, 0-equal, -2 not applied

func AnyGetType

func AnyGetType(v interface{}) int

func AnyToBoolean

func AnyToBoolean(v interface{}) bool

func AnyToByteArray added in v1.0.2

func AnyToByteArray(v interface{}) []byte

func AnyToDvGrammarExpressionValue added in v1.0.2

func AnyToDvGrammarExpressionValue(v interface{}) *dvgrammar.ExpressionValue

func AnyToNumber

func AnyToNumber(v interface{}) float64

func AnyToNumberInt

func AnyToNumberInt(v interface{}) (f int64, ok bool)

func AnyToString

func AnyToString(v interface{}) string

func AnyToStringWithOptions added in v1.0.2

func AnyToStringWithOptions(v interface{}, options int) string

func AnyWithTypeToBoolean

func AnyWithTypeToBoolean(kind int, v interface{}, defValue bool) bool

func AnyWithTypeToNumber

func AnyWithTypeToNumber(kind int, v interface{}) float64

func AnyWithTypeToNumberInt

func AnyWithTypeToNumberInt(kind int, v interface{}) (int64, bool)

func AnyWithTypeToString

func AnyWithTypeToString(kind int, v interface{}) (string, bool)

func ApplyDvFunction

func ApplyDvFunction(context *dvgrammar.ExpressionContext, self interface{}, args []interface{}) (interface{}, error)

func ArrowFunctionOperator added in v1.0.2

func ArrowFunctionOperator(tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext) (int, *dvgrammar.ExpressionValue, error)

func AssignArrayStringToVariable

func AssignArrayStringToVariable(parent *DvVariable, variableDefinition string, data []string, force bool) error

func AssignIntToVariable

func AssignIntToVariable(parent *DvVariable, variableDefinition string, data int, force bool) error

func AssignMapStringToVariable

func AssignMapStringToVariable(parent *DvVariable, variableDefinition string, data map[string]string, force bool) error

func AssignVariable

func AssignVariable(parent *DvVariable, keys []string, value interface{}, force bool) error

func AssignVariableByKey added in v1.0.2

func AssignVariableByKey(parent *DvVariable, key string, value interface{}, force bool) error

func AssignVariableDirect

func AssignVariableDirect(parent *DvVariable, val interface{}) error

func AssignVariableToVariable

func AssignVariableToVariable(parent *DvVariable, variableDefinition string, data interface{}, force bool) error

func BindDvFunction

func BindDvFunction(context *dvgrammar.ExpressionContext, self interface{}, args []interface{}) (interface{}, error)

func BitwiseNotOperator

func BitwiseNotOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string, lastVarName string, lastParent *dvgrammar.ExpressionValue) (*dvgrammar.ExpressionValue, error)

func BreakOperator added in v1.0.2

func CalculateAllNodeParams added in v1.0.2

func CalculateAllNodeParams(args []*dvgrammar.BuildNode, context *dvgrammar.ExpressionContext) ([]interface{}, error)

func CalculateDefined

func CalculateDefined(data []byte, scope dvgrammar.ScopeInterface, reference *dvgrammar.SourceReference, visitorOptions int) (*dvgrammar.ExpressionValue, error)

func CalculateTernaryOperator added in v1.0.2

func CalculateTernaryOperator(condNode, node1, node2 *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext) (*dvgrammar.ExpressionValue, error)

func CalculatorDataGetter

func CalculatorDataGetter(token *dvgrammar.Token, context *dvgrammar.ExpressionContext) (*dvgrammar.ExpressionValue, error)

func CalculatorEvaluator

func CalculatorEvaluator(data []byte, scope dvgrammar.ScopeInterface, reference *dvgrammar.SourceReference, visitorOptions int) (*dvgrammar.ExpressionValue, error)

func CallDvFunction

func CallDvFunction(context *dvgrammar.ExpressionContext, self interface{}, args []interface{}) (interface{}, error)

func CollectJsonVariables added in v1.0.2

func CollectJsonVariables(data interface{}, params map[string]string, env *DvObject, anyway bool, prefix string, upperCase bool)

func CollectValueByKey added in v1.0.2

func CollectValueByKey(data interface{}, key string, env *DvObject) (interface{}, interface{}, error)

func CollectValuesByMap added in v1.0.2

func CollectValuesByMap(data interface{}, params map[string]string, env *DvObject) (res map[string]interface{})

func CollectVariablesByAnyMap added in v1.0.2

func CollectVariablesByAnyMap(src map[string]interface{}, params map[string]string, data *DvObject, anyway bool, prefix string, upperCase bool)

func CollectVariablesByStringMap added in v1.0.2

func CollectVariablesByStringMap(src map[string]string, params map[string]string, data *DvObject, anyway bool, prefix string, upperCase bool)

func CompareAsIntegers

func CompareAsIntegers(value1 interface{}, value2 interface{}) int

func CompareAsNumbers

func CompareAsNumbers(value1 interface{}, value2 interface{}) int

func CompareAsStrings

func CompareAsStrings(value1 interface{}, value2 interface{}) int

func CompareByComparisonType

func CompareByComparisonType(compareType int, value1 interface{}, value2 interface{}) int

func ContainInProcess added in v1.0.2

func ContainInProcess(contained interface{}, containing interface{}) bool

func ContinueOperator added in v1.0.2

func ContinueOperator(tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext) (int, *dvgrammar.ExpressionValue, error)

func ConvertAnyTypeToJson added in v1.0.2

func ConvertAnyTypeToJson(buf []byte, v interface{}) []byte

func ConvertAnyTypeToJsonString added in v1.0.2

func ConvertAnyTypeToJsonString(data interface{}) string

func ConvertByteArrayToIntOrDouble added in v1.0.2

func ConvertByteArrayToIntOrDouble(data []byte) (interface{}, bool)

func ConvertDvFieldInfoToProperties added in v1.0.2

func ConvertDvFieldInfoToProperties(item *DvVariable, index int) map[string]interface{}

func ConvertInt64ToBuf added in v1.0.2

func ConvertInt64ToBuf(buf []byte, v int64) []byte

func ConvertIntToBuf added in v1.0.2

func ConvertIntToBuf(buf []byte, v int) []byte

func ConvertInterfaceListToStringList added in v1.0.2

func ConvertInterfaceListToStringList(list []interface{}, options int) []string

func ConvertInterfaceListsMapToStringListsMap added in v1.0.2

func ConvertInterfaceListsMapToStringListsMap(listMap map[string][][]interface{}, options int) map[string][][]string

func ConvertInterfaceListsToStringLists added in v1.0.2

func ConvertInterfaceListsToStringLists(list [][]interface{}, options int) [][]string

func ConvertSimpleKindAndValueToInterface added in v1.0.2

func ConvertSimpleKindAndValueToInterface(kind int, data []byte) (interface{}, bool)

func ConvertSimpleTypeToBuf added in v1.0.2

func ConvertSimpleTypeToBuf(buf []byte, v interface{}) ([]byte, bool, int)

func ConvertSimpleTypeToString added in v1.0.2

func ConvertSimpleTypeToString(v interface{}) (string, bool)

func ConvertStringArrayToInterfaceArray added in v1.0.2

func ConvertStringArrayToInterfaceArray(data []string) (res []interface{})

func ConvertStringMapToDvVariableMap

func ConvertStringMapToDvVariableMap(data map[string]string) (res map[string]*DvVariable)

func ConvertUnsignedInt64ToBuf added in v1.0.2

func ConvertUnsignedInt64ToBuf(buf []byte, v uint64) []byte

func ConvertUnsignedIntToBuf added in v1.0.2

func ConvertUnsignedIntToBuf(buf []byte, v uint) []byte

func ConvertVariableNameToKeys

func ConvertVariableNameToKeys(data string) (res []string, err error)

func CreateFunctionContainer added in v1.0.2

func CreateFunctionContainer(params []string, body []*dvgrammar.BuildNode, options int, name string) (*dvgrammar.ExpressionValue, error)

func CurlyBraceNoParentProcessor added in v1.0.2

func CurlyBraceNoParentProcessor(parent *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, rest []*dvgrammar.BuildNode) (value *dvgrammar.ExpressionValue, parentValue *dvgrammar.ExpressionValue, toStop bool, err error, noNextParent bool)

func CurlyBraceParentProcessor added in v1.0.2

func CurlyBraceParentProcessor(parent *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, rest []*dvgrammar.BuildNode) (value *dvgrammar.ExpressionValue, parentValue *dvgrammar.ExpressionValue, toStop bool, err error, noNextParent bool)

func DeleteOperator added in v1.0.2

func DeleteOperator(tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext) (int, *dvgrammar.ExpressionValue, error)

func DeleteVariable

func DeleteVariable(parent *DvVariable, keys []string, silent bool) error

func DvObjectInternalToString

func DvObjectInternalToString(obj *DvObject) string

func ExecFunction

func ExecFunction(context *dvgrammar.ExpressionContext, fn interface{}, self interface{}, arguments []interface{}) (interface{}, error)

func ExecuteAnyFunction added in v1.0.2

func ExecuteAnyFunction(context *dvgrammar.ExpressionContext, fn interface{}, thisArg interface{}, args []interface{}) (value interface{}, err error)

func ExecuteCycleCommon added in v1.0.2

func ExecuteCycleCommon(context *dvgrammar.ExpressionContext, initValues []*dvgrammar.BuildNode, condValue []*dvgrammar.BuildNode, stepValues []*dvgrammar.BuildNode, cycleBody []*dvgrammar.BuildNode, condAtFirst bool) (int, *dvgrammar.ExpressionValue, error)

func ExecuteCycleInOf added in v1.0.2

func ExecuteCycleInOf(context *dvgrammar.ExpressionContext, inof *dvgrammar.BuildNode, cycleBody []*dvgrammar.BuildNode, mode int) (int, *dvgrammar.ExpressionValue, error)

func ExecuteIfClauseCommon added in v1.0.2

func ExecuteIfClauseCommon(context *dvgrammar.ExpressionContext, ifClauseCondition []*dvgrammar.BuildNode, ifThenClause []*dvgrammar.BuildNode, ifElseClause []*dvgrammar.BuildNode) (int, *dvgrammar.ExpressionValue, error)

func ExpressionEvaluation added in v1.0.2

func ExpressionEvaluation(expr string, resolver ExpressionResolver) (string, error)

func ExtractPureName added in v1.0.2

func ExtractPureName(tree *dvgrammar.BuildNode) (string, error)

func ForCycleOperator added in v1.0.2

func ForCycleOperator(tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext) (int, *dvgrammar.ExpressionValue, error)

func FunctionApply

func FunctionApply(context *dvgrammar.ExpressionContext, thisVariable interface{}, params []interface{}) (interface{}, error)

func FunctionBind

func FunctionBind(context *dvgrammar.ExpressionContext, thisVariable interface{}, params []interface{}) (interface{}, error)

func FunctionCall

func FunctionCall(context *dvgrammar.ExpressionContext, thisVariable interface{}, params []interface{}) (interface{}, error)

func GetBooleanValue added in v1.0.2

func GetBooleanValue(isTrue bool) []byte

func GetChildrenOfAnyByRange added in v1.0.2

func GetChildrenOfAnyByRange(src interface{}, startIndex int, endIndex int) interface{}

func GetColumnSubNodes added in v1.0.2

func GetColumnSubNodes(node *dvgrammar.BuildNode) (*dvgrammar.BuildNode, *dvgrammar.BuildNode, bool)

func GetDvFunctionArguments

func GetDvFunctionArguments(funcObj *DvObject) []string

func GetEscapedString

func GetEscapedString(s string) string

func GetExpressionValueChild added in v1.0.2

func GetExpressionValueChild(value *dvgrammar.ExpressionValue, index *dvgrammar.ExpressionValue, context *dvgrammar.ExpressionContext) (*dvgrammar.ExpressionValue, error)

func GetExpressionValueRange added in v1.0.2

func GetExpressionValueRange(value *dvgrammar.ExpressionValue, indexFrom int, indexTo int) (*dvgrammar.ExpressionValue, error)

func GetFunctionCodeList added in v1.0.2

func GetFunctionCodeList(tree *dvgrammar.BuildNode) ([]*dvgrammar.BuildNode, error)

func GetFunctionObjectVariable added in v1.0.2

func GetFunctionObjectVariable(fn *DvFunction, selfVal *dvgrammar.ExpressionValue, context *dvgrammar.ExpressionContext) (*dvgrammar.ExpressionValue, error)

func GetFunctionParameterList added in v1.0.2

func GetFunctionParameterList(tree *dvgrammar.BuildNode) ([]string, error)

func GetIntFromVariable

func GetIntFromVariable(parent *DvVariable, variableDefinition string, force bool) (res int, err error)

func GetIntFromVariableAndIncrementAfter

func GetIntFromVariableAndIncrementAfter(parent *DvVariable, variableDefinition string, force bool) (res int, err error)

func GetIntFromVariableAndModify

func GetIntFromVariableAndModify(parent *DvVariable, variableDefinition string, modify int, after bool, force bool) (res int, err error)

func GetLatestKeyInJsonPath added in v1.0.2

func GetLatestKeyInJsonPath(path string) string

func GetLeftestQuestionNode added in v1.0.2

func GetLeftestQuestionNode(tree *dvgrammar.BuildNode) (*dvgrammar.BuildNode, error)

func GetLengthOfAny added in v1.0.2

func GetLengthOfAny(v interface{}) int

func GetNumberKindFromString

func GetNumberKindFromString(v []byte, n int) (int, int, int64, float64)

func GetStringAtChar added in v1.0.2

func GetStringAtChar(s string, index int) *dvgrammar.ExpressionValue

func GetStringFromVariable

func GetStringFromVariable(parent *DvVariable, variableDefinition string, force bool) (res string, err error)

func GetVariableByDefinition

func GetVariableByDefinition(parent *DvVariable, variableDefinition string) (thisValue *DvVariable, child *DvVariable, prototyped bool, err error, keys []string)

func GetVariableByKeys

func GetVariableByKeys(parent *DvVariable, keys []string, silent bool) (thisValue *DvVariable, child *DvVariable, prototyped bool, err error)

func IfClauseOperator added in v1.0.2

func IfClauseOperator(tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext) (int, *dvgrammar.ExpressionValue, error)

func Init

func Init() bool

func IsDefined

func IsDefined(data []byte, scope dvgrammar.ScopeInterface, row int, col int, place string, visitorOptions int) (int, error)

func IsFunction

func IsFunction(v interface{}) bool

func IsNotNullish added in v1.0.2

func IsNotNullish(v interface{}) bool

func IsSimpleJsonPath added in v1.0.2

func IsSimpleJsonPath(path string) bool

func LogicalDataGetter

func LogicalDataGetter(token *dvgrammar.Token, context *dvgrammar.ExpressionContext) (*dvgrammar.ExpressionValue, error)

func LogicalNotOperator

func LogicalNotOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string, lastVarName string, lastParent *dvgrammar.ExpressionValue) (*dvgrammar.ExpressionValue, error)

func MatchDvFieldInfo added in v1.0.2

func MatchDvFieldInfo(model *DvVariable, pattern *DvVariable) bool

func MeetItemExpression added in v1.0.2

func MeetItemExpression(expr string, item *DvVariable, resolver ExpressionResolver, options int, index int) (bool, error)

func ModifySimpleValueAfterGet

func ModifySimpleValueAfterGet(thisVal *DvVariable, child *DvVariable, prototyped bool, value string, tp int, keys []string) error

func NumberToInt

func NumberToInt(v float64) (f int64, ok bool)

func ParentheseNoParentProcessor added in v1.0.2

func ParentheseNoParentProcessor(parent *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, rest []*dvgrammar.BuildNode) (value *dvgrammar.ExpressionValue, parentValue *dvgrammar.ExpressionValue, toStop bool, err error, noNextParent bool)

func ParentheseParentProcessor added in v1.0.2

func ParentheseParentProcessor(parent *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, rest []*dvgrammar.BuildNode) (value *dvgrammar.ExpressionValue, parentValue *dvgrammar.ExpressionValue, toStop bool, err error, noNextParent bool)

func ParseForDvObjectShort added in v1.0.2

func ParseForDvObjectShort(data string, params *DvObject) (interface{}, error)

func ParseForDvObjectString added in v1.0.2

func ParseForDvObjectString(data string, params *DvObject) (string, error)

func PostMinusMinusOperator

func PostMinusMinusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string, lastVarName string, lastParent *dvgrammar.ExpressionValue) (*dvgrammar.ExpressionValue, error)

func PostPlusPlusOperator

func PostPlusPlusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string, lastVarName string, lastParent *dvgrammar.ExpressionValue) (*dvgrammar.ExpressionValue, error)

func PreMinusMinusOperator

func PreMinusMinusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string, lastVarName string, lastParent *dvgrammar.ExpressionValue) (*dvgrammar.ExpressionValue, error)

func PrePlusPlusOperator

func PrePlusPlusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string, lastVarName string, lastParent *dvgrammar.ExpressionValue) (*dvgrammar.ExpressionValue, error)

func ProcessorAssign added in v1.0.2

func ProcessorAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorBoolAnd

func ProcessorBoolAnd(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorBoolAndAssign added in v1.0.2

func ProcessorBoolAndAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorBoolOr

func ProcessorBoolOr(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorBoolOrAssign added in v1.0.2

func ProcessorBoolOrAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorBoolXor

func ProcessorBoolXor(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorBoolXorAssign added in v1.0.2

func ProcessorBoolXorAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorBooleanAnd

func ProcessorBooleanAnd(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (res *dvgrammar.ExpressionValue, err error)

func ProcessorBooleanAndAssign added in v1.0.2

func ProcessorBooleanAndAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorBooleanOr

func ProcessorBooleanOr(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (res *dvgrammar.ExpressionValue, err error)

func ProcessorBooleanOrAssign added in v1.0.2

func ProcessorBooleanOrAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorBooleanOrNullable added in v1.0.2

func ProcessorBooleanOrNullable(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (res *dvgrammar.ExpressionValue, err error)

func ProcessorBooleanOrNullableAssign added in v1.0.2

func ProcessorBooleanOrNullableAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorColon added in v1.0.2

func ProcessorColon(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorContainsIn added in v1.0.2

func ProcessorContainsIn(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorDivision

func ProcessorDivision(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorDivisionAssign added in v1.0.2

func ProcessorDivisionAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorElseInsideIf added in v1.0.2

func ProcessorElseInsideIf(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorEqual

func ProcessorEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorEqualExact

func ProcessorEqualExact(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorGreaterEqual

func ProcessorGreaterEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorGreaterThan

func ProcessorGreaterThan(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorInInsideFor added in v1.0.2

func ProcessorInInsideFor(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorLeftShift

func ProcessorLeftShift(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorLeftShiftAssign added in v1.0.2

func ProcessorLeftShiftAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorLessEqual

func ProcessorLessEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorLessThan

func ProcessorLessThan(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorLogicalRightShift

func ProcessorLogicalRightShift(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorLogicalRightShiftAssign added in v1.0.2

func ProcessorLogicalRightShiftAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorMinus

func ProcessorMinus(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorMinusAssign added in v1.0.2

func ProcessorMinusAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorMultiply

func ProcessorMultiply(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorMultiplyAssign added in v1.0.2

func ProcessorMultiplyAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorNotEqual

func ProcessorNotEqual(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorNotEqualExact

func ProcessorNotEqualExact(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorOfInsideFor added in v1.0.2

func ProcessorOfInsideFor(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorPercent

func ProcessorPercent(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorPercentAssign added in v1.0.2

func ProcessorPercentAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorPlus

func ProcessorPlus(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorPlusAssign added in v1.0.2

func ProcessorPlusAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorPower

func ProcessorPower(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorPowerAssign added in v1.0.2

func ProcessorPowerAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorQuestion added in v1.0.2

func ProcessorQuestion(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorRightShift

func ProcessorRightShift(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProcessorRightShiftAssign added in v1.0.2

func ProcessorRightShiftAssign(values []*dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string) (*dvgrammar.ExpressionValue, error)

func ProvideRootValues added in v1.0.2

func ProvideRootValues(env *DvObject)

func PutVariablesInScope added in v1.0.2

func PutVariablesInScope(params []string, args []interface{}, context *dvgrammar.ExpressionContext) error

func QuickVariableArrayEvaluation

func QuickVariableArrayEvaluation(parent *DvVariable, data []string) (res []interface{}, err error)

func RefillDvGrammarTypePrototyper added in v1.0.2

func RefillDvGrammarTypePrototyper()

func RefillDvVariableTypePrototyper added in v1.0.2

func RefillDvVariableTypePrototyper()

func RegisterContainInProcessor added in v1.0.2

func RegisterContainInProcessor(fn ContainInProcessor)

func RegisterJsonFullParser added in v1.0.2

func RegisterJsonFullParser(fn ProcessByteArray) bool

func RegisterToStringConverter added in v1.0.2

func RegisterToStringConverter(converter MethodToStringConverter)

func RemoveAnyVariable added in v1.0.2

func RemoveAnyVariable(srcAny interface{}, path string, env *DvObject) interface{}

func ReturnOperator added in v1.0.2

func ReturnOperator(tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext) (int, *dvgrammar.ExpressionValue, error)

func SetNodeValue

func SetNodeValue(tree *dvgrammar.BuildNode, v interface{}, dataType int, context *dvgrammar.ExpressionContext, lastVarName string, lastParent *dvgrammar.ExpressionValue) error

func SquareBracketNoParentProcessor added in v1.0.2

func SquareBracketNoParentProcessor(parent *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, rest []*dvgrammar.BuildNode) (value *dvgrammar.ExpressionValue, parentValue *dvgrammar.ExpressionValue, toStop bool, err error, noNextParent bool)

func SquareBracketParentProcessor added in v1.0.2

func SquareBracketParentProcessor(parent *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, rest []*dvgrammar.BuildNode) (value *dvgrammar.ExpressionValue, parentValue *dvgrammar.ExpressionValue, toStop bool, err error, noNextParent bool)

func StringToAny

func StringToAny(v string) interface{}

func StringToNumber

func StringToNumber(v string) float64

func UnaryMinusOperator

func UnaryMinusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string, lastVarName string, lastParent *dvgrammar.ExpressionValue) (*dvgrammar.ExpressionValue, error)

func UnaryPlusOperator

func UnaryPlusOperator(value *dvgrammar.ExpressionValue, tree *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext, operator string, lastVarName string, lastParent *dvgrammar.ExpressionValue) (*dvgrammar.ExpressionValue, error)

func UpdateAnyVariables added in v1.0.2

func UpdateAnyVariables(srcAny interface{}, valAny interface{}, path string, mode int, ids []string, env *DvObject) interface{}

func ValidateNumber

func ValidateNumber(data string) error

Types

type ContainInProcessor added in v1.0.2

type ContainInProcessor func(interface{}, interface{}) (bool, bool, error)

type CustomJsFunction added in v1.0.2

type CustomJsFunction struct {
	Params  []string
	Body    []*dvgrammar.BuildNode
	Options int
}

type DvCall

type DvCall struct {
	Input  []string `json:"input"`
	Name   string   `json:"name"`
	Output string   `json:"output"`
}

type DvContext

type DvContext struct {
	// contains filtered or unexported fields
}

func (*DvContext) CurrentRoutineCallBreak

func (context *DvContext) CurrentRoutineCallBreak() error

func (*DvContext) CurrentRoutineCallExecute

func (context *DvContext) CurrentRoutineCallExecute(routine *DvRoutine) (bool, error)

func (*DvContext) CurrentRoutineCallShift

func (context *DvContext) CurrentRoutineCallShift(delta int) (int, error)

func (*DvContext) DumpContextMemory

func (context *DvContext) DumpContextMemory()

func (*DvContext) ExecuteCurrentRoutine

func (context *DvContext) ExecuteCurrentRoutine() (bool, error)

func (*DvContext) ExecuteRoutine

func (context *DvContext) ExecuteRoutine(routine *DvRoutine) error

func (*DvContext) ExecuteRoutines

func (context *DvContext) ExecuteRoutines(routines []string, params []string) error

func (*DvContext) FunctionCallByKeys

func (context *DvContext) FunctionCallByKeys(variable *DvVariable, keys []string, params []interface{}, thisVariable *DvVariable) (interface{}, error)

func (*DvContext) FunctionCallByVariableDefinition

func (context *DvContext) FunctionCallByVariableDefinition(variable *DvVariable, variableDefinition string, params []interface{}, thisVariable *DvVariable) (interface{}, error)

func (*DvContext) FunctionCallByVariableDefinitionWithStringParams

func (context *DvContext) FunctionCallByVariableDefinitionWithStringParams(variable *DvVariable, variableDefinition string, params []string, thisVariable *DvVariable) (interface{}, error)

func (*DvContext) RoutineCallExecute

func (context *DvContext) RoutineCallExecute(dvCall *DvCall) error

func (*DvContext) SetGeneralArguments

func (context *DvContext) SetGeneralArguments(params map[string]string) error

type DvFunc

type DvFunc func(*dvgrammar.ExpressionContext, interface{}, []interface{}) (interface{}, error)

type DvFunction

type DvFunction struct {
	Name      string
	Args      []string
	Fn        DvFunc
	FnSpecial DvSpecialFunc
	Immediate bool
	Special   bool
}

func (*DvFunction) ToString

func (fn *DvFunction) ToString() string

type DvFunctionObject added in v1.0.2

type DvFunctionObject struct {
	SelfRef  interface{}
	Context  *dvgrammar.ExpressionContext
	Executor *DvFunction
}

func (*DvFunctionObject) ExecuteDvFunctionWithTreeArguments added in v1.0.2

func (fn *DvFunctionObject) ExecuteDvFunctionWithTreeArguments(args []interface{}, context *dvgrammar.ExpressionContext) (*dvgrammar.ExpressionValue, error)

type DvObject

type DvObject struct {
	Value      interface{}
	Options    int
	Properties map[string]interface{}
	Prototype  *DvObject
}
var DvFunctionPrototype *DvObject

func GetFunctionPrototypeFromMasterVariable added in v1.0.2

func GetFunctionPrototypeFromMasterVariable(name string) *DvObject

func GetPrototypeForDvGrammarExpressionValue added in v1.0.2

func GetPrototypeForDvGrammarExpressionValue(value *dvgrammar.ExpressionValue) *DvObject

func NewDvFunction

func NewDvFunction(name string, args []string, fn DvFunc) *DvObject

func NewDvObject

func NewDvObject(properties map[string]string, prototype *DvObject) *DvObject

func NewDvObjectFrom2Maps

func NewDvObjectFrom2Maps(localMap map[string]string, globalMap map[string]string) *DvObject

func NewDvObjectWithGlobalPrototype

func NewDvObjectWithGlobalPrototype(properties map[string]string) *DvObject

func NewDvObjectWithSpecialValues

func NewDvObjectWithSpecialValues(value interface{}, kind int, proto *DvObject, properties map[string]interface{}) *DvObject

func NewObject

func NewObject(properties map[string]interface{}) *DvObject

func NewObjectWithPrototype

func NewObjectWithPrototype(properties map[string]interface{}, prototype *DvObject) *DvObject

func (*DvObject) AssignProperties

func (obj *DvObject) AssignProperties(properties map[string]interface{})

func (*DvObject) CalculateExpression

func (obj *DvObject) CalculateExpression(b []byte) ([]byte, error)

func (*DvObject) CalculateString

func (obj *DvObject) CalculateString(str string) (string, error)

func (*DvObject) CalculateStringWithBrackets

func (obj *DvObject) CalculateStringWithBrackets(b []byte, level int) (string, error)

func (*DvObject) Delete added in v1.0.2

func (obj *DvObject) Delete(key string)

func (*DvObject) DeleteAtParent added in v1.0.2

func (obj *DvObject) DeleteAtParent(key string, level int)

func (*DvObject) EvaluateAnyTypeExpression added in v1.0.2

func (obj *DvObject) EvaluateAnyTypeExpression(s string) (interface{}, error)

func (*DvObject) EvaluateBooleanExpression added in v1.0.2

func (obj *DvObject) EvaluateBooleanExpression(s string) (bool, error)

func (*DvObject) EvaluateStringTypeExpression added in v1.0.2

func (obj *DvObject) EvaluateStringTypeExpression(s string) (string, error)

func (*DvObject) FindFirstNotEmptyString added in v1.0.2

func (obj *DvObject) FindFirstNotEmptyString(keys []string) string

func (*DvObject) Get

func (obj *DvObject) Get(key string) (interface{}, bool)

func (*DvObject) GetFirstString added in v1.0.2

func (obj *DvObject) GetFirstString(key string) string

func (*DvObject) GetInt added in v1.0.2

func (obj *DvObject) GetInt(key string) int

func (*DvObject) GetObjectType

func (obj *DvObject) GetObjectType() int

func (*DvObject) GetString

func (obj *DvObject) GetString(key string) string

func (*DvObject) ReadAtParent added in v1.0.2

func (obj *DvObject) ReadAtParent(key string, level int) (res interface{}, ok bool)

func (*DvObject) Set

func (obj *DvObject) Set(key string, value interface{})

func (*DvObject) SetAtParent added in v1.0.2

func (obj *DvObject) SetAtParent(key string, value interface{}, level int)

func (*DvObject) SetPropertiesWithPrefixFromString added in v1.0.2

func (obj *DvObject) SetPropertiesWithPrefixFromString(prefix string, values map[string]string, options int)

func (*DvObject) SetProperty

func (obj *DvObject) SetProperty(name string, value interface{})

func (*DvObject) ToBoolean

func (obj *DvObject) ToBoolean() bool

func (*DvObject) ToNumber

func (obj *DvObject) ToNumber() float64

func (*DvObject) ToNumberInt

func (obj *DvObject) ToNumberInt() (int64, bool)

func (*DvObject) ToString

func (obj *DvObject) ToString() string

type DvRoutine

type DvRoutine struct {
	Name         string   `json:"name"`
	Calls        []DvCall `json:"calls"`
	Dependencies []string `json:"dependencies"`
}

type DvScript

type DvScript struct {
	// contains filtered or unexported fields
}

func ParseScripts

func ParseScripts(scripts []string) (*DvScript, error)

func (*DvScript) AddRoutines

func (engine *DvScript) AddRoutines(routines []DvRoutine) error

func (*DvScript) GetNewContext

func (engine *DvScript) GetNewContext() *DvContext

func (*DvScript) VerifyRoutines

func (engine *DvScript) VerifyRoutines(routines []string) error

type DvVariable

type DvVariable struct {
	Name        []byte
	Value       []byte
	Kind        int
	Fields      []*DvVariable
	Extra       interface{}
	Prototype   *DvVariable
	QuickSearch *QuickSearchInfo
}
var ArrayMaster *DvVariable = RegisterMasterVariable("Array", &DvVariable{Kind: FIELD_OBJECT})
var FunctionMaster *DvVariable = RegisterMasterVariable("Function", &DvVariable{
	Fields: make([]*DvVariable, 0, 7),
	Kind:   FIELD_OBJECT,
	Prototype: &DvVariable{
		Fields: []*DvVariable{
			{
				Name: []byte("call"),
				Kind: FIELD_FUNCTION,
				Extra: &DvFunction{
					Fn: FunctionCall,
				},
			},
			{
				Name: []byte("apply"),
				Kind: FIELD_FUNCTION,
				Extra: &DvFunction{
					Fn: FunctionApply,
				},
			},
			{
				Name: []byte("bind"),
				Kind: FIELD_FUNCTION,
				Extra: &DvFunction{
					Fn: FunctionBind,
				},
			},
		},
		Kind: FIELD_OBJECT,
	},
})
var ObjectMaster *DvVariable = RegisterMasterVariable("Object", &DvVariable{Kind: FIELD_OBJECT})
var RegExpMaster *DvVariable = RegisterMasterVariable("RegExp", &DvVariable{Kind: FIELD_OBJECT})
var StringMaster *DvVariable = RegisterMasterVariable("String", &DvVariable{Kind: FIELD_OBJECT})
var WindowMaster *DvVariable = RegisterMasterVariable("window", &DvVariable{Kind: FIELD_OBJECT})

func AnyStructToDvVariable added in v1.0.2

func AnyStructToDvVariable(source interface{}) (*DvVariable, error)

func AnyToDvVariable added in v1.0.2

func AnyToDvVariable(v interface{}) *DvVariable

func ConvertAnyToDvVariable added in v1.0.2

func ConvertAnyToDvVariable(data interface{}) *DvVariable

func ConvertDvFunctionToDvVariable

func ConvertDvFunctionToDvVariable(fn *DvFunction) *DvVariable

func ConvertMapDvVariableToList added in v1.0.2

func ConvertMapDvVariableToList(varMap map[string]*DvVariable) []*DvVariable

func ConvertStringArrayToDvVariableArray

func ConvertStringArrayToDvVariableArray(data []string) (res []*DvVariable)

func ConvertStringMapToDvVariable added in v1.0.2

func ConvertStringMapToDvVariable(m map[string]string) *DvVariable

func ConvertToObjectKeyPair added in v1.0.2

func ConvertToObjectKeyPair(node *dvgrammar.BuildNode, context *dvgrammar.ExpressionContext) (*DvVariable, bool, error)

func CreateDvVariableByPathAndData added in v1.0.2

func CreateDvVariableByPathAndData(path string, data interface{}, parent *DvVariable) *DvVariable

func DvVariableFromArray

func DvVariableFromArray(parent *DvVariable, data []*DvVariable) *DvVariable

func DvVariableFromInt

func DvVariableFromInt(parent *DvVariable, data int) *DvVariable

func DvVariableFromMap

func DvVariableFromMap(parent *DvVariable, data map[string]*DvVariable) *DvVariable

func DvVariableFromString

func DvVariableFromString(parent *DvVariable, data string) *DvVariable

func DvVariableFromStringArray

func DvVariableFromStringArray(parent *DvVariable, data []string) *DvVariable

func DvVariableFromStringMap

func DvVariableFromStringMap(parent *DvVariable, data map[string]string) *DvVariable

func DvVariableGetNewObject

func DvVariableGetNewObject() *DvVariable

func ExecuteProcessorFunction added in v1.0.2

func ExecuteProcessorFunction(name string, params string, parent *DvVariable) (*DvVariable, error)

func FindInArray added in v1.0.2

func FindInArray(parent *DvVariable, pattern *DvVariable, fromIndex int) (*DvVariable, error)

func FindItemByExpression added in v1.0.2

func FindItemByExpression(expr string, resolver ExpressionResolver, item *DvVariable, strict bool) (*DvVariable, error)

func ProcessorFind added in v1.0.2

func ProcessorFind(parent *DvVariable, params string) (*DvVariable, error)

func QuickNumberEvaluation

func QuickNumberEvaluation(parent *DvVariable, data string) (res *DvVariable, err error)

func QuickStringEvaluation

func QuickStringEvaluation(parent *DvVariable, data string) (res *DvVariable, err error)

func QuickVariableEvaluation

func QuickVariableEvaluation(parent *DvVariable, data string) (res *DvVariable, err error)

func RegisterMasterObject

func RegisterMasterObject(name string, values map[string]*DvVariable, functions map[string]*DvFunction) *DvVariable

func RegisterMasterVariable

func RegisterMasterVariable(name string, variable *DvVariable) *DvVariable

func (*DvVariable) AddField added in v1.0.2

func (field *DvVariable) AddField(item *DvVariable) bool

func (*DvVariable) AddStringField added in v1.0.2

func (field *DvVariable) AddStringField(key string, value string) bool

func (*DvVariable) AssignToSubField added in v1.0.2

func (item *DvVariable) AssignToSubField(field string, value string, env *DvObject) error

func (*DvVariable) CleanFields added in v1.0.2

func (variable *DvVariable) CleanFields(keys []string)

func (*DvVariable) CleanValue added in v1.0.2

func (variable *DvVariable) CleanValue()

func (*DvVariable) Clone added in v1.0.2

func (item *DvVariable) Clone() *DvVariable

func (*DvVariable) CloneExceptKey added in v1.0.2

func (item *DvVariable) CloneExceptKey(other *DvVariable, deep bool) *DvVariable

func (*DvVariable) CloneWithKey added in v1.0.2

func (item *DvVariable) CloneWithKey(other *DvVariable, deep bool) *DvVariable

func (*DvVariable) CompareDvFieldByFields added in v1.0.2

func (item *DvVariable) CompareDvFieldByFields(other *DvVariable, fields []string) int

func (*DvVariable) CompareWholeDvField added in v1.0.2

func (item *DvVariable) CompareWholeDvField(other *DvVariable) int

func (*DvVariable) ContainsItemIn added in v1.0.2

func (item *DvVariable) ContainsItemIn(v interface{}) bool

func (*DvVariable) ConvertSimpleValueToInterface added in v1.0.2

func (item *DvVariable) ConvertSimpleValueToInterface() (interface{}, bool)

func (*DvVariable) ConvertValueToInterface added in v1.0.2

func (item *DvVariable) ConvertValueToInterface() (interface{}, bool)

func (*DvVariable) CopyFieldsFromOther added in v1.0.2

func (variable *DvVariable) CopyFieldsFromOther(keys []string, other *DvVariable)

func (*DvVariable) CopyFieldsToMap added in v1.0.2

func (variable *DvVariable) CopyFieldsToMap(prefix string, data map[string]interface{})

func (*DvVariable) CreateQuickInfoByKeys added in v1.0.2

func (item *DvVariable) CreateQuickInfoByKeys(ids []string)

func (*DvVariable) CreateQuickInfoForObjectType added in v1.0.2

func (item *DvVariable) CreateQuickInfoForObjectType()

func (*DvVariable) CreateQuickInfoForSingleItemByKeys added in v1.0.2

func (item *DvVariable) CreateQuickInfoForSingleItemByKeys(ids []string) string

func (*DvVariable) DeleteChildByIndex added in v1.0.2

func (item *DvVariable) DeleteChildByIndex(ind int)

func (*DvVariable) DvVariableToAnyStruct added in v1.0.2

func (item *DvVariable) DvVariableToAnyStruct(result interface{}) error

func (*DvVariable) EvaluateDvFieldItem added in v1.0.2

func (item *DvVariable) EvaluateDvFieldItem(expression string, env *DvObject) (bool, error)

func (*DvVariable) FindChildByKey added in v1.0.2

func (item *DvVariable) FindChildByKey(key string) (*DvVariable, bool)

func (*DvVariable) FindChildIndexByKey added in v1.0.2

func (item *DvVariable) FindChildIndexByKey(key string) int

func (*DvVariable) FindDifferenceByQuickMap added in v1.0.2

func (item *DvVariable) FindDifferenceByQuickMap(other *DvVariable,
	fillAdded bool, fillRemoved bool, fillUpdated bool, fillUnchanged bool,
	fillUpdatedCounterpart bool, unchangedAsUpdated bool, useIndex bool) (added *DvVariable, removed *DvVariable,
	updated *DvVariable, unchanged *DvVariable, counterparts *DvVariable)

func (*DvVariable) FindIndex added in v1.0.2

func (item *DvVariable) FindIndex(key string) int

func (*DvVariable) GetChildrenByRange added in v1.0.2

func (item *DvVariable) GetChildrenByRange(startIndex int, count int) *DvVariable

func (*DvVariable) GetDvObjectByPrototypes added in v1.0.2

func (dv *DvVariable) GetDvObjectByPrototypes() *DvObject

func (*DvVariable) GetIntValue

func (variable *DvVariable) GetIntValue(force bool) (int, error)

func (*DvVariable) GetLength added in v1.0.2

func (item *DvVariable) GetLength() int

func (*DvVariable) GetPrototypeByKind added in v1.0.2

func (item *DvVariable) GetPrototypeByKind() *DvObject

func (*DvVariable) GetStringArrayMap

func (variable *DvVariable) GetStringArrayMap() (res map[string][]string)

func (*DvVariable) GetStringArrayValue

func (variable *DvVariable) GetStringArrayValue() []string

func (*DvVariable) GetStringInterfaceMap added in v1.0.2

func (variable *DvVariable) GetStringInterfaceMap() (res map[string]interface{})

func (*DvVariable) GetStringMap

func (variable *DvVariable) GetStringMap() (res map[string]string)

func (*DvVariable) GetStringValue

func (item *DvVariable) GetStringValue() string

func (*DvVariable) GetStringValueAsBytes

func (variable *DvVariable) GetStringValueAsBytes() []byte

func (*DvVariable) GetStringValueJS added in v1.0.2

func (variable *DvVariable) GetStringValueJS() string

func (*DvVariable) GetStringValueJson added in v1.0.2

func (item *DvVariable) GetStringValueJson() string

func (*DvVariable) GetVariableArray

func (variable *DvVariable) GetVariableArray(force bool) ([]*DvVariable, error)

func (*DvVariable) IndexOf added in v1.0.2

func (item *DvVariable) IndexOf(child *DvVariable) int

func (*DvVariable) IndexOfByKey added in v1.0.2

func (item *DvVariable) IndexOfByKey(field []byte) int

func (*DvVariable) InsertAtSimplePath added in v1.0.2

func (item *DvVariable) InsertAtSimplePath(path string, child *DvVariable) bool

func (*DvVariable) IsEmpty added in v1.0.2

func (variable *DvVariable) IsEmpty() bool

func (*DvVariable) JsonStringify

func (variable *DvVariable) JsonStringify() []byte

func (*DvVariable) JsonStringifyNonEmpty

func (variable *DvVariable) JsonStringifyNonEmpty() []byte

func (*DvVariable) MakeCopyWithNewKey added in v1.0.2

func (item *DvVariable) MakeCopyWithNewKey(key string) *DvVariable

func (*DvVariable) MergeArraysByIds added in v1.0.2

func (item *DvVariable) MergeArraysByIds(other *DvVariable, ids []string, mode int)

func (*DvVariable) MergeAtChild added in v1.0.2

func (item *DvVariable) MergeAtChild(index int, child *DvVariable, mode int) bool

func (*DvVariable) MergeItemIntoArraysByIds added in v1.0.2

func (item *DvVariable) MergeItemIntoArraysByIds(other *DvVariable, ids []string, mode int, init bool)

func (*DvVariable) MergeObjectIntoObject added in v1.0.2

func (item *DvVariable) MergeObjectIntoObject(other *DvVariable, replace bool, deep bool)

func (*DvVariable) MergeOtherVariable added in v1.0.2

func (item *DvVariable) MergeOtherVariable(other *DvVariable, mode int, ids []string) *DvVariable

func (*DvVariable) ObjectGet

func (variable *DvVariable) ObjectGet(key string) (*DvVariable, error)

func (*DvVariable) ObjectGetByKeys

func (variable *DvVariable) ObjectGetByKeys(keys []string) (*DvVariable, error)

func (*DvVariable) ObjectGetByVariableDefinition

func (variable *DvVariable) ObjectGetByVariableDefinition(variableDefinition string) (*DvVariable, error)

func (*DvVariable) ObjectInPrototypedChain

func (variable *DvVariable) ObjectInPrototypedChain(key string) *DvVariable

func (*DvVariable) ReadChild added in v1.0.2

func (item *DvVariable) ReadChild(childName string, resolver ExpressionResolver) (res *DvVariable, parent *DvVariable, err error)

func (*DvVariable) ReadChildIntArrayValue added in v1.0.2

func (item *DvVariable) ReadChildIntArrayValue(fieldName string) (res []int, err error)

func (*DvVariable) ReadChildMapValue added in v1.0.2

func (item *DvVariable) ReadChildMapValue(fieldName string) map[string]string

func (*DvVariable) ReadChildOfAnyLevel added in v1.0.2

func (item *DvVariable) ReadChildOfAnyLevel(name string, props *DvObject) (res *DvVariable, parent *DvVariable, err error)

func (*DvVariable) ReadChildStringArrayValue added in v1.0.2

func (item *DvVariable) ReadChildStringArrayValue(fieldName string) []string

func (*DvVariable) ReadChildStringValue added in v1.0.2

func (item *DvVariable) ReadChildStringValue(fieldName string) string

func (*DvVariable) ReadPath added in v1.0.2

func (item *DvVariable) ReadPath(childName string, rejectChildOfUndefined bool, env *DvObject) (*DvVariable, *DvVariable, error)

func (*DvVariable) ReadSimpleChild added in v1.0.2

func (item *DvVariable) ReadSimpleChild(fieldName string) *DvVariable

func (*DvVariable) ReadSimpleChildValue added in v1.0.2

func (item *DvVariable) ReadSimpleChildValue(fieldName string) string

func (*DvVariable) ReadSimpleString added in v1.0.2

func (item *DvVariable) ReadSimpleString() (string, error)

func (*DvVariable) ReadSimpleStringList added in v1.0.2

func (item *DvVariable) ReadSimpleStringList(data []string) ([]string, error)

func (*DvVariable) ReadSimpleStringMap added in v1.0.2

func (item *DvVariable) ReadSimpleStringMap(data map[string]string) error

func (*DvVariable) RemoveChild added in v1.0.2

func (item *DvVariable) RemoveChild(child *DvVariable)

func (*DvVariable) SetField added in v1.0.2

func (variable *DvVariable) SetField(key string, value *DvVariable) int

func (*DvVariable) SetSimpleValue

func (variable *DvVariable) SetSimpleValue(value string, kind int) error

func (*DvVariable) ToDvGrammarExpressionValue added in v1.0.2

func (item *DvVariable) ToDvGrammarExpressionValue() *dvgrammar.ExpressionValue

type DvVariable_DumpInfo

type DvVariable_DumpInfo struct {
	// contains filtered or unexported fields
}

type EvaluateBoolean

type EvaluateBoolean struct {
	FinalResult bool
	Err         error
}

func EvalAsBoolean

func EvalAsBoolean(data []byte, paramMap *DvObject, row int, column int, place string) (r EvaluateBoolean)

type EvaluateResult

type EvaluateResult struct {
	FinalResult interface{}
	Err         error
	EndPos      int
}

func FindEndAndParse

func FindEndAndParse(data []byte, pos int, limit int, sequenceLimit int, globalMap map[string]string, localMap map[string]string, row int, column int, place string) *EvaluateResult

func Parse

func Parse(data []byte, globalMap map[string]string, localMap map[string]string, row int, column int, place string) (r *EvaluateResult)

func ParseForDvObject

func ParseForDvObject(data []byte, params *DvObject, row int, column int, place string) *EvaluateResult

type ExpressionResolver added in v1.0.2

type ExpressionResolver func(string, map[string]interface{}, int) (string, error)

type MethodToStringConverter added in v1.0.2

type MethodToStringConverter func(v interface{}) (string, bool)

type ObjectStack added in v1.0.2

type ObjectStack struct {
	BaseLevel    *DvObject
	CurrentLevel *DvObject
}

func NewObjectStack added in v1.0.2

func NewObjectStack(object *DvObject) *ObjectStack

func (*ObjectStack) Get added in v1.0.2

func (obj *ObjectStack) Get(key string) (interface{}, bool)

func (*ObjectStack) Set added in v1.0.2

func (obj *ObjectStack) Set(key string, value interface{})

func (*ObjectStack) SetDeep added in v1.0.2

func (obj *ObjectStack) SetDeep(key string, value interface{})

func (*ObjectStack) StackPop added in v1.0.2

func (obj *ObjectStack) StackPop()

func (*ObjectStack) StackPush added in v1.0.2

func (obj *ObjectStack) StackPush(option int)

type ProcessByteArray added in v1.0.2

type ProcessByteArray func([]byte) (*DvVariable, error)
var JsonFullParser ProcessByteArray

type ProcessorFunction added in v1.0.2

type ProcessorFunction func(parent *DvVariable, params string) (*DvVariable, error)

type QuickSearchInfo added in v1.0.2

type QuickSearchInfo struct {
	Looker map[string]*DvVariable
	Key    string
}

Directories

Path Synopsis
********************************************************************** MicroCore Copyright 2020-2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************
********************************************************************** MicroCore Copyright 2020-2020 by Danyil Dobryvechir (dobrivecher@yahoo.com ddobryvechir@gmail.com) ***********************************************************************

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL