Documentation ¶
Index ¶
- func ListContainsValue(val interface{}, array []interface{}, typ reflect.Type) bool
- func RegisterFunc(f Function)
- type ArrayExpr
- type BiExpr
- type EvalFunc
- type Expression
- type FuncExpr
- type Function
- type InExpr
- type IsTypeExpr
- type MatchExpr
- type NotExpr
- type OP
- type TExprParserVisitor
- func (v *TExprParserVisitor) VisitArray(ctx *ast.ArrayContext) interface{}
- func (v *TExprParserVisitor) VisitAtom(ctx *ast.AtomContext) interface{}
- func (v *TExprParserVisitor) VisitBinary(ctx *ast.BinaryContext) interface{}
- func (v *TExprParserVisitor) VisitBinaryExpression(ctx *ast.BinaryExpressionContext) interface{}
- func (v *TExprParserVisitor) VisitBit(ctx *ast.BitContext) interface{}
- func (v *TExprParserVisitor) VisitBoolean(ctx *ast.BooleanContext) interface{}
- func (v *TExprParserVisitor) VisitBooleans(ctx *ast.BooleansContext) interface{}
- func (v *TExprParserVisitor) VisitCalc(ctx *ast.CalcContext) interface{}
- func (v *TExprParserVisitor) VisitCalcExpression(ctx *ast.CalcExpressionContext) interface{}
- func (v *TExprParserVisitor) VisitComparator(ctx *ast.ComparatorContext) interface{}
- func (v *TExprParserVisitor) VisitComparatorExpression(ctx *ast.ComparatorExpressionContext) interface{}
- func (v *TExprParserVisitor) VisitContainer(ctx *ast.ContainerContext) interface{}
- func (v *TExprParserVisitor) VisitFloats(ctx *ast.FloatsContext) interface{}
- func (v *TExprParserVisitor) VisitFuncname(ctx *ast.FuncnameContext) interface{}
- func (v *TExprParserVisitor) VisitFunction(ctx *ast.FunctionContext) interface{}
- func (v *TExprParserVisitor) VisitInExpression(ctx *ast.InExpressionContext) interface{}
- func (v *TExprParserVisitor) VisitIntegers(ctx *ast.IntegersContext) interface{}
- func (v *TExprParserVisitor) VisitIsNotTypeExpression(ctx *ast.IsNotTypeExpressionContext) interface{}
- func (v *TExprParserVisitor) VisitIsTypeExpression(ctx *ast.IsTypeExpressionContext) interface{}
- func (v *TExprParserVisitor) VisitKind(ctx *ast.KindContext) interface{}
- func (v *TExprParserVisitor) VisitLiteral(ctx *ast.LiteralContext) interface{}
- func (v *TExprParserVisitor) VisitMatchExpression(ctx *ast.MatchExpressionContext) interface{}
- func (v *TExprParserVisitor) VisitMultiplying(ctx *ast.MultiplyingContext) interface{}
- func (v *TExprParserVisitor) VisitNotExpression(ctx *ast.NotExpressionContext) interface{}
- func (v *TExprParserVisitor) VisitNotInExpression(ctx *ast.NotInExpressionContext) interface{}
- func (v *TExprParserVisitor) VisitNumber(ctx *ast.NumberContext) interface{}
- func (v *TExprParserVisitor) VisitParameters(ctx *ast.ParametersContext) interface{}
- func (v *TExprParserVisitor) VisitParenExpression(ctx *ast.ParenExpressionContext) interface{}
- func (v *TExprParserVisitor) VisitParse(ctx *ast.ParseContext) interface{}
- func (v *TExprParserVisitor) VisitPlus(ctx *ast.PlusContext) interface{}
- func (v *TExprParserVisitor) VisitRegex(ctx *ast.RegexContext) interface{}
- func (v *TExprParserVisitor) VisitScientific(ctx *ast.ScientificContext) interface{}
- func (v *TExprParserVisitor) VisitShift(ctx *ast.ShiftContext) interface{}
- func (v *TExprParserVisitor) VisitStrings(ctx *ast.StringsContext) interface{}
- func (v *TExprParserVisitor) VisitVariable(ctx *ast.VariableContext) interface{}
- func (v *TExprParserVisitor) VisitVariableExpression(ctx *ast.VariableExpressionContext) interface{}
- type ValueExpression
- type ValueGetter
- type VariableExpr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListContainsValue ¶
func RegisterFunc ¶ added in v1.0.8
func RegisterFunc(f Function)
Types ¶
type ArrayExpr ¶
type ArrayExpr struct { Array []Expression Type reflect.Type }
func (*ArrayExpr) Eval ¶
func (e *ArrayExpr) Eval(vg ValueGetter) (interface{}, error)
type BiExpr ¶
type BiExpr struct {
// contains filtered or unexported fields
}
func (*BiExpr) Eval ¶
func (e *BiExpr) Eval(vg ValueGetter) (interface{}, error)
type EvalFunc ¶ added in v1.0.8
type EvalFunc struct {
Function
}
func (*EvalFunc) Execute ¶ added in v1.0.8
func (f *EvalFunc) Execute(vg ValueGetter, params []interface{}) (interface{}, error)
type Expression ¶
type Expression interface { Eval(vg ValueGetter) (interface{}, error) String() string }
func Compile ¶
func Compile(expr string) (Expression, error)
func MustCompile ¶
func MustCompile(expr string) Expression
func NewBiBoolExpr ¶
func NewBiBoolExpr(left, right Expression, op *OP) Expression
func NewBiCalcExpr ¶
func NewBiCalcExpr(left, right Expression, op *OP) Expression
func NewMatchExpr ¶
func NewMatchExpr(left Expression, regex string) (Expression, error)
type FuncExpr ¶ added in v1.0.8
type FuncExpr struct {
// contains filtered or unexported fields
}
func NewFuncExpr ¶ added in v1.0.8
func NewFuncExpr(name string, function Function, params []Expression) *FuncExpr
func (*FuncExpr) Eval ¶ added in v1.0.8
func (e *FuncExpr) Eval(vg ValueGetter) (interface{}, error)
type Function ¶ added in v1.0.8
type Function interface { Execute(vg ValueGetter, params []interface{}) (interface{}, error) Name() string }
type InExpr ¶
type InExpr struct {
// contains filtered or unexported fields
}
func (*InExpr) Eval ¶
func (e *InExpr) Eval(vg ValueGetter) (interface{}, error)
type IsTypeExpr ¶
type IsTypeExpr struct {
// contains filtered or unexported fields
}
func (*IsTypeExpr) Eval ¶
func (e *IsTypeExpr) Eval(vg ValueGetter) (interface{}, error)
func (*IsTypeExpr) String ¶
func (e *IsTypeExpr) String() string
type MatchExpr ¶
type MatchExpr struct {
// contains filtered or unexported fields
}
func (*MatchExpr) Eval ¶
func (e *MatchExpr) Eval(vg ValueGetter) (interface{}, error)
type NotExpr ¶
type NotExpr struct {
// contains filtered or unexported fields
}
func (*NotExpr) Eval ¶
func (e *NotExpr) Eval(vg ValueGetter) (interface{}, error)
type TExprParserVisitor ¶ added in v1.0.8
type TExprParserVisitor struct {
ast.TExprParserVisitor
}
func (*TExprParserVisitor) VisitArray ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitArray(ctx *ast.ArrayContext) interface{}
func (*TExprParserVisitor) VisitAtom ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitAtom(ctx *ast.AtomContext) interface{}
func (*TExprParserVisitor) VisitBinary ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitBinary(ctx *ast.BinaryContext) interface{}
func (*TExprParserVisitor) VisitBinaryExpression ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitBinaryExpression(ctx *ast.BinaryExpressionContext) interface{}
func (*TExprParserVisitor) VisitBit ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitBit(ctx *ast.BitContext) interface{}
func (*TExprParserVisitor) VisitBoolean ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitBoolean(ctx *ast.BooleanContext) interface{}
func (*TExprParserVisitor) VisitBooleans ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitBooleans(ctx *ast.BooleansContext) interface{}
func (*TExprParserVisitor) VisitCalc ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitCalc(ctx *ast.CalcContext) interface{}
func (*TExprParserVisitor) VisitCalcExpression ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitCalcExpression(ctx *ast.CalcExpressionContext) interface{}
func (*TExprParserVisitor) VisitComparator ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitComparator(ctx *ast.ComparatorContext) interface{}
func (*TExprParserVisitor) VisitComparatorExpression ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitComparatorExpression(ctx *ast.ComparatorExpressionContext) interface{}
func (*TExprParserVisitor) VisitContainer ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitContainer(ctx *ast.ContainerContext) interface{}
func (*TExprParserVisitor) VisitFloats ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitFloats(ctx *ast.FloatsContext) interface{}
func (*TExprParserVisitor) VisitFuncname ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitFuncname(ctx *ast.FuncnameContext) interface{}
func (*TExprParserVisitor) VisitFunction ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitFunction(ctx *ast.FunctionContext) interface{}
func (*TExprParserVisitor) VisitInExpression ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitInExpression(ctx *ast.InExpressionContext) interface{}
func (*TExprParserVisitor) VisitIntegers ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitIntegers(ctx *ast.IntegersContext) interface{}
func (*TExprParserVisitor) VisitIsNotTypeExpression ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitIsNotTypeExpression(ctx *ast.IsNotTypeExpressionContext) interface{}
func (*TExprParserVisitor) VisitIsTypeExpression ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitIsTypeExpression(ctx *ast.IsTypeExpressionContext) interface{}
func (*TExprParserVisitor) VisitKind ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitKind(ctx *ast.KindContext) interface{}
func (*TExprParserVisitor) VisitLiteral ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitLiteral(ctx *ast.LiteralContext) interface{}
func (*TExprParserVisitor) VisitMatchExpression ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitMatchExpression(ctx *ast.MatchExpressionContext) interface{}
func (*TExprParserVisitor) VisitMultiplying ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitMultiplying(ctx *ast.MultiplyingContext) interface{}
func (*TExprParserVisitor) VisitNotExpression ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitNotExpression(ctx *ast.NotExpressionContext) interface{}
func (*TExprParserVisitor) VisitNotInExpression ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitNotInExpression(ctx *ast.NotInExpressionContext) interface{}
func (*TExprParserVisitor) VisitNumber ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitNumber(ctx *ast.NumberContext) interface{}
func (*TExprParserVisitor) VisitParameters ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitParameters(ctx *ast.ParametersContext) interface{}
func (*TExprParserVisitor) VisitParenExpression ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitParenExpression(ctx *ast.ParenExpressionContext) interface{}
func (*TExprParserVisitor) VisitParse ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitParse(ctx *ast.ParseContext) interface{}
func (*TExprParserVisitor) VisitPlus ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitPlus(ctx *ast.PlusContext) interface{}
func (*TExprParserVisitor) VisitRegex ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitRegex(ctx *ast.RegexContext) interface{}
func (*TExprParserVisitor) VisitScientific ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitScientific(ctx *ast.ScientificContext) interface{}
func (*TExprParserVisitor) VisitShift ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitShift(ctx *ast.ShiftContext) interface{}
func (*TExprParserVisitor) VisitStrings ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitStrings(ctx *ast.StringsContext) interface{}
func (*TExprParserVisitor) VisitVariable ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitVariable(ctx *ast.VariableContext) interface{}
func (*TExprParserVisitor) VisitVariableExpression ¶ added in v1.0.8
func (v *TExprParserVisitor) VisitVariableExpression(ctx *ast.VariableExpressionContext) interface{}
type ValueExpression ¶
type ValueExpression struct {
// contains filtered or unexported fields
}
func NewValueExpression ¶
func NewValueExpression(value interface{}) *ValueExpression
func (*ValueExpression) Eval ¶
func (e *ValueExpression) Eval(vg ValueGetter) (interface{}, error)
func (*ValueExpression) String ¶
func (e *ValueExpression) String() string
type ValueGetter ¶
type ValueGetter interface {
Get(name string) interface{}
}
type VariableExpr ¶
type VariableExpr struct {
// contains filtered or unexported fields
}
func (*VariableExpr) Eval ¶
func (e *VariableExpr) Eval(vg ValueGetter) (interface{}, error)
func (*VariableExpr) String ¶
func (e *VariableExpr) String() string
Click to show internal directories.
Click to hide internal directories.