Versions in this module Expand all Collapse all v0 v0.0.1 Dec 22, 2022 Changes in this version + const DefaultExprName + const ExprNameSeparator + const FieldSeparator + func FakeBool(v interface{}) bool + func JoinExprSelector(pathFields []string, exprName string) string + func JoinFieldSelector(path ...string) string + func RegFunc(funcName string, fn func(...interface{}) interface{}, force ...bool) error + type Boolean = bool + type Expr struct + type ExprHandler struct + func (e *ExprHandler) Eval() interface{} + func (e *ExprHandler) EvalBool() bool + func (e *ExprHandler) EvalFloat() float64 + func (e *ExprHandler) EvalString() string + func (e *ExprHandler) ExprSelector() ExprSelector + func (e *ExprHandler) Path() string + func (e *ExprHandler) StringSelector() string + func (e *ExprHandler) TagExpr() *TagExpr + type ExprNode interface + LeftOperand func() ExprNode + Parent func() ExprNode + RightOperand func() ExprNode + Run func(context.Context, string, *TagExpr) interface{} + SetLeftOperand func(ExprNode) + SetParent func(ExprNode) + SetRightOperand func(ExprNode) + String func() string + type ExprSelector string + func (e ExprSelector) Field() string + func (e ExprSelector) Name() string + func (e ExprSelector) ParentField() (string, bool) + func (e ExprSelector) Split() (field FieldSelector, name string) + func (e ExprSelector) String() string + type FieldHandler struct + func (f *FieldHandler) EvalFuncs() map[ExprSelector]func() interface{} + func (f *FieldHandler) FieldSelector() FieldSelector + func (f *FieldHandler) StringSelector() string + func (f *FieldHandler) StructField() reflect.StructField + func (f *FieldHandler) Value(initZero bool) reflect.Value + type FieldSelector string + func (f FieldSelector) Name() string + func (f FieldSelector) Parent() (string, bool) + func (f FieldSelector) Split() (paths []string, name string) + func (f FieldSelector) String() string + type Null = interface + type Number = float64 + type String = string + type TagExpr struct + func (t *TagExpr) Eval(exprSelector string) interface{} + func (t *TagExpr) EvalBool(exprSelector string) bool + func (t *TagExpr) EvalFloat(exprSelector string) float64 + func (t *TagExpr) EvalString(exprSelector string) string + func (t *TagExpr) Field(fieldSelector string) (fh *FieldHandler, found bool) + func (t *TagExpr) Range(fn func(*ExprHandler) error) error + func (t *TagExpr) RangeFields(fn func(*FieldHandler) bool) bool + type VM struct + func New(tagName ...string) *VM + func (vm *VM) MustRun(structOrStructPtrOrReflectValue interface{}) *TagExpr + func (vm *VM) Run(structPtrOrReflectValue interface{}) (*TagExpr, error) + func (vm *VM) RunAny(v interface{}, fn func(*TagExpr, error) error) error