Versions in this module Expand all Collapse all v0 v0.2.0 May 24, 2021 v0.1.1 May 24, 2021 v0.1.0 May 24, 2021 Changes in this version + func Between(a Expr) func(x, b Expr) Expr + func BuiltinFunctions() map[string]func(args ...Expr) (Expr, error) + func Equal(a, b Expr) bool + func IsArithmeticOperator(op Operator) bool + func IsComparisonOperator(op Operator) bool + func OperatorIsIndexCompatible(op Operator) bool + func Walk(e Expr, fn func(Expr) bool) bool + type Aggregator interface + Aggregate func(env *Environment) error + type AggregatorBuilder interface + Aggregator func() Aggregator + type AndOp struct + func (op *AndOp) Eval(env *Environment) (document.Value, error) + func (op AndOp) IsEqual(other Expr) bool + func (op AndOp) LeftHand() Expr + func (op AndOp) Precedence() int + func (op AndOp) RightHand() Expr + func (op AndOp) SetLeftHandExpr(a Expr) + func (op AndOp) SetRightHandExpr(b Expr) + func (op AndOp) String() string + func (op AndOp) Token() scanner.Token + type AvgAggregator struct + Avg float64 + Counter int64 + Fn *AvgFunc + func (s *AvgAggregator) Aggregate(env *Environment) error + func (s *AvgAggregator) Eval(env *Environment) (document.Value, error) + func (s *AvgAggregator) String() string + type AvgFunc struct + Expr Expr + func (s *AvgFunc) Aggregator() Aggregator + func (s *AvgFunc) Eval(env *Environment) (document.Value, error) + func (s *AvgFunc) IsEqual(other Expr) bool + func (s *AvgFunc) Params() []Expr + func (s *AvgFunc) String() string + type BetweenOperator struct + X Expr + func (op *BetweenOperator) Eval(env *Environment) (document.Value, error) + func (op *BetweenOperator) String() string + func (op BetweenOperator) IsEqual(other Expr) bool + func (op BetweenOperator) LeftHand() Expr + func (op BetweenOperator) Precedence() int + func (op BetweenOperator) RightHand() Expr + func (op BetweenOperator) SetLeftHandExpr(a Expr) + func (op BetweenOperator) SetRightHandExpr(b Expr) + func (op BetweenOperator) Token() scanner.Token + type CastFunc struct + CastAs document.ValueType + Expr Expr + func (c CastFunc) Eval(env *Environment) (document.Value, error) + func (c CastFunc) IsEqual(other Expr) bool + func (c CastFunc) Params() []Expr + func (c CastFunc) String() string + type ConcatOperator struct + func (op *ConcatOperator) Eval(env *Environment) (document.Value, error) + func (op ConcatOperator) IsEqual(other Expr) bool + func (op ConcatOperator) LeftHand() Expr + func (op ConcatOperator) Precedence() int + func (op ConcatOperator) RightHand() Expr + func (op ConcatOperator) SetLeftHandExpr(a Expr) + func (op ConcatOperator) SetRightHandExpr(b Expr) + func (op ConcatOperator) String() string + func (op ConcatOperator) Token() scanner.Token + type CountAggregator struct + Count int64 + Fn *CountFunc + func (c *CountAggregator) Aggregate(env *Environment) error + func (c *CountAggregator) Eval(env *Environment) (document.Value, error) + func (c *CountAggregator) String() string + type CountFunc struct + Count int64 + Expr Expr + Wildcard bool + func (c *CountFunc) Aggregator() Aggregator + func (c *CountFunc) Eval(env *Environment) (document.Value, error) + func (c *CountFunc) IsEqual(other Expr) bool + func (c *CountFunc) Params() []Expr + func (c *CountFunc) String() string + type Environment struct + Doc document.Document + Outer *Environment + Params []Param + Tx *database.Transaction + Vars *document.FieldBuffer + func NewEnvironment(d document.Document, params ...Param) *Environment + func (e *Environment) Clone() (*Environment, error) + func (e *Environment) Get(path document.Path) (v document.Value, ok bool) + func (e *Environment) GetDocument() (document.Document, bool) + func (e *Environment) GetParamByIndex(pos int) (document.Value, error) + func (e *Environment) GetParamByName(name string) (v document.Value, err error) + func (e *Environment) GetTx() *database.Transaction + func (e *Environment) Set(name string, v document.Value) + func (e *Environment) SetDocument(d document.Document) + type Expr interface + Eval func(*Environment) (document.Value, error) + String func() string + func Add(a, b Expr) Expr + func And(a, b Expr) Expr + func BitwiseAnd(a, b Expr) Expr + func BitwiseOr(a, b Expr) Expr + func BitwiseXor(a, b Expr) Expr + func Concat(a, b Expr) Expr + func Div(a, b Expr) Expr + func Eq(a, b Expr) Expr + func Gt(a, b Expr) Expr + func Gte(a, b Expr) Expr + func In(a, b Expr) Expr + func Is(a, b Expr) Expr + func IsNot(a, b Expr) Expr + func Like(a, b Expr) Expr + func Lt(a, b Expr) Expr + func Lte(a, b Expr) Expr + func Mod(a, b Expr) Expr + func Mul(a, b Expr) Expr + func Neq(a, b Expr) Expr + func Not(e Expr) Expr + func NotIn(a, b Expr) Expr + func NotLike(a, b Expr) Expr + func Or(a, b Expr) Expr + func Sub(a, b Expr) Expr + type Function interface + Params func() []Expr + type Functions struct + func NewFunctions() Functions + func (f Functions) AddFunc(name string, fn func(args ...Expr) (Expr, error)) + func (f Functions) GetFunc(name string, args ...Expr) (Expr, error) + type InOperator struct + func (op *InOperator) Eval(env *Environment) (document.Value, error) + func (op InOperator) IsEqual(other Expr) bool + func (op InOperator) LeftHand() Expr + func (op InOperator) Precedence() int + func (op InOperator) RightHand() Expr + func (op InOperator) SetLeftHandExpr(a Expr) + func (op InOperator) SetRightHandExpr(b Expr) + func (op InOperator) String() string + func (op InOperator) Token() scanner.Token + type IsNotOperator struct + func (op *IsNotOperator) Eval(env *Environment) (document.Value, error) + func (op *IsNotOperator) String() string + func (op IsNotOperator) IsEqual(other Expr) bool + func (op IsNotOperator) LeftHand() Expr + func (op IsNotOperator) Precedence() int + func (op IsNotOperator) RightHand() Expr + func (op IsNotOperator) SetLeftHandExpr(a Expr) + func (op IsNotOperator) SetRightHandExpr(b Expr) + func (op IsNotOperator) Token() scanner.Token + type IsOperator struct + func (op *IsOperator) Eval(env *Environment) (document.Value, error) + func (op IsOperator) IsEqual(other Expr) bool + func (op IsOperator) LeftHand() Expr + func (op IsOperator) Precedence() int + func (op IsOperator) RightHand() Expr + func (op IsOperator) SetLeftHandExpr(a Expr) + func (op IsOperator) SetRightHandExpr(b Expr) + func (op IsOperator) String() string + func (op IsOperator) Token() scanner.Token + type KVPair struct + K string + V Expr + func (p KVPair) String() string + type KVPairs struct + Pairs []KVPair + SelfReferenced bool + func (kvp *KVPairs) IsEqual(other Expr) bool + func (kvp KVPairs) Eval(env *Environment) (document.Value, error) + func (kvp KVPairs) String() string + type LikeOperator struct + func (op *LikeOperator) Eval(env *Environment) (document.Value, error) + func (op LikeOperator) IsEqual(other Expr) bool + func (op LikeOperator) LeftHand() Expr + func (op LikeOperator) Precedence() int + func (op LikeOperator) RightHand() Expr + func (op LikeOperator) SetLeftHandExpr(a Expr) + func (op LikeOperator) SetRightHandExpr(b Expr) + func (op LikeOperator) String() string + func (op LikeOperator) Token() scanner.Token + type LiteralExprList []Expr + func (l LiteralExprList) Eval(env *Environment) (document.Value, error) + func (l LiteralExprList) IsEqual(other Expr) bool + func (l LiteralExprList) String() string + type LiteralValue document.Value + func (v LiteralValue) Eval(*Environment) (document.Value, error) + func (v LiteralValue) IsEqual(other Expr) bool + func (v LiteralValue) String() string + type MaxAggregator struct + Fn *MaxFunc + Max document.Value + func (m *MaxAggregator) Aggregate(env *Environment) error + func (m *MaxAggregator) Eval(env *Environment) (document.Value, error) + func (m *MaxAggregator) String() string + type MaxFunc struct + Expr Expr + func (m *MaxFunc) Aggregator() Aggregator + func (m *MaxFunc) Eval(env *Environment) (document.Value, error) + func (m *MaxFunc) IsEqual(other Expr) bool + func (m *MaxFunc) Params() []Expr + func (m *MaxFunc) String() string + type MinAggregator struct + Fn *MinFunc + Min document.Value + func (m *MinAggregator) Aggregate(env *Environment) error + func (m *MinAggregator) Eval(env *Environment) (document.Value, error) + func (m *MinAggregator) String() string + type MinFunc struct + Expr Expr + func (m *MinFunc) Aggregator() Aggregator + func (m *MinFunc) Eval(env *Environment) (document.Value, error) + func (m *MinFunc) IsEqual(other Expr) bool + func (m *MinFunc) Params() []Expr + func (m *MinFunc) String() string + type NamedExpr struct + ExprName string + func (e NamedExpr) Name() string + func (e NamedExpr) String() string + type NamedParam string + func (p NamedParam) Eval(env *Environment) (document.Value, error) + func (p NamedParam) IsEqual(other Expr) bool + func (p NamedParam) String() string + type NotInOperator struct + func (op *NotInOperator) Eval(env *Environment) (document.Value, error) + func (op *NotInOperator) String() string + func (op NotInOperator) IsEqual(other Expr) bool + func (op NotInOperator) LeftHand() Expr + func (op NotInOperator) Precedence() int + func (op NotInOperator) RightHand() Expr + func (op NotInOperator) SetLeftHandExpr(a Expr) + func (op NotInOperator) SetRightHandExpr(b Expr) + func (op NotInOperator) Token() scanner.Token + type NotLikeOperator struct + func (op *NotLikeOperator) Eval(env *Environment) (document.Value, error) + func (op *NotLikeOperator) String() string + func (op NotLikeOperator) IsEqual(other Expr) bool + func (op NotLikeOperator) LeftHand() Expr + func (op NotLikeOperator) Precedence() int + func (op NotLikeOperator) RightHand() Expr + func (op NotLikeOperator) SetLeftHandExpr(a Expr) + func (op NotLikeOperator) SetRightHandExpr(b Expr) + func (op NotLikeOperator) Token() scanner.Token + type NotOp struct + func (op *NotOp) Eval(env *Environment) (document.Value, error) + func (op *NotOp) String() string + func (op NotOp) IsEqual(other Expr) bool + func (op NotOp) LeftHand() Expr + func (op NotOp) Precedence() int + func (op NotOp) RightHand() Expr + func (op NotOp) SetLeftHandExpr(a Expr) + func (op NotOp) SetRightHandExpr(b Expr) + func (op NotOp) Token() scanner.Token + type Operator interface + LeftHand func() Expr + Precedence func() int + RightHand func() Expr + SetLeftHandExpr func(Expr) + SetRightHandExpr func(Expr) + Token func() scanner.Token + type OrOp struct + func (op *OrOp) Eval(env *Environment) (document.Value, error) + func (op OrOp) IsEqual(other Expr) bool + func (op OrOp) LeftHand() Expr + func (op OrOp) Precedence() int + func (op OrOp) RightHand() Expr + func (op OrOp) SetLeftHandExpr(a Expr) + func (op OrOp) SetRightHandExpr(b Expr) + func (op OrOp) String() string + func (op OrOp) Token() scanner.Token + type PKFunc struct + func (*PKFunc) Params() []Expr + func (k *PKFunc) Eval(env *Environment) (document.Value, error) + func (k *PKFunc) IsEqual(other Expr) bool + func (k *PKFunc) String() string + type Param struct + Name string + Value interface{} + type Parentheses struct + E Expr + func (p Parentheses) Eval(env *Environment) (document.Value, error) + func (p Parentheses) IsEqual(other Expr) bool + func (p Parentheses) String() string + type Path document.Path + func (p Path) Eval(env *Environment) (document.Value, error) + func (p Path) IsEqual(other Expr) bool + func (p Path) String() string + type PositionalParam int + func (p PositionalParam) Eval(env *Environment) (document.Value, error) + func (p PositionalParam) IsEqual(other Expr) bool + func (p PositionalParam) String() string + type SumAggregator struct + Fn *SumFunc + SumF *float64 + SumI *int64 + func (s *SumAggregator) Aggregate(env *Environment) error + func (s *SumAggregator) Eval(env *Environment) (document.Value, error) + func (s *SumAggregator) String() string + type SumFunc struct + Expr Expr + func (s *SumFunc) Aggregator() Aggregator + func (s *SumFunc) Eval(env *Environment) (document.Value, error) + func (s *SumFunc) IsEqual(other Expr) bool + func (s *SumFunc) Params() []Expr + func (s *SumFunc) String() string + type Wildcard struct + func (w Wildcard) Eval(env *Environment) (document.Value, error) + func (w Wildcard) Iterate(env *Environment, fn func(field string, value document.Value) error) error + func (w Wildcard) String() string