Versions in this module Expand all Collapse all v0 v0.0.2 May 3, 2021 v0.0.1 May 3, 2021 Changes in this version + var DefaultDialect *lex.Dialect = lex.LogicalExpressionDialect + var ErrIncludeNotFound = fmt.Errorf("Include Not Found") + var ErrIntOverflowNode = fmt.Errorf("proto: integer overflow") + var ErrInternalError = fmt.Errorf("Internal Error") + var ErrInvalidLengthNode = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrMaxDepth = fmt.Errorf("Recursive Evaluation Error") + var ErrNoIncluder = fmt.Errorf("No Includer is available") + var ErrNotImplemented = fmt.Errorf("Not implemented") + var ErrNotSupported = fmt.Errorf("Not supported") + var ErrUnknownCommand = fmt.Errorf("Unknown Command") + var Trace bool + func EmptyEvalFunc(ctx EvalContext, args []value.Value) (value.Value, bool) + func FilterSpecialIdentities(l []string) []string + func FindAllIdentityField(node Node) []string + func FindAllLeftIdentityFields(node Node) []string + func FindFirstIdentity(node Node) string + func FindIdentityName(depth int, node Node, prefix string) string + func FindIncludes(node Node) []string + func FuncAdd(name string, fn CustomFunc) + func IdentityMaybeEscapeBuf(buf *bytes.Buffer, quote byte, ident string) + func IdentityMaybeQuote(quote byte, ident string) string + func IdentityMaybeQuoteStrict(quote byte, ident string) string + func IdentityMaybeQuoteStrictBuf(buf *bytes.Buffer, quote byte, ident string) + func IdentityTrim(ident string) string + func IsValidIdentity(identity string) bool + func LeftRight(val string) (string, string, bool) + func LiteralQuoteEscape(quote rune, literal string) string + func LiteralQuoteEscapeBuf(buf *bytes.Buffer, quote rune, literal string) + func NodesEqual(n1, n2 Node) bool + func StringEscape(quote rune, literal string) string + func StringUnEscape(quote rune, val string) (string, bool) + func ValueArray(depth int, pg TokenPager) (value.Value, error) + func ValueTypeFromNode(n Node) value.ValueType + type AggFunc interface + IsAgg func() bool + type ArrayNode struct + Args []Node + func NewArrayNode() *ArrayNode + func NewArrayNodeArgs(args []Node) *ArrayNode + func (m *ArrayNode) Append(n Node) + func (m *ArrayNode) ChildrenArgs() []Node + func (m *ArrayNode) Equal(n Node) bool + func (m *ArrayNode) Expr() *Expr + func (m *ArrayNode) FromExpr(e *Expr) error + func (m *ArrayNode) FromPB(n *NodePb) Node + func (m *ArrayNode) NodePb() *NodePb + func (m *ArrayNode) NodeType() string + func (m *ArrayNode) String() string + func (m *ArrayNode) Validate() error + func (m *ArrayNode) WriteDialect(w DialectWriter) + type ArrayNodePb struct + Args []NodePb + Wrap *int32 + XXX_unrecognized []byte + func (*ArrayNodePb) Descriptor() ([]byte, []int) + func (*ArrayNodePb) ProtoMessage() + func (m *ArrayNodePb) Marshal() (data []byte, err error) + func (m *ArrayNodePb) MarshalTo(data []byte) (int, error) + func (m *ArrayNodePb) Reset() + func (m *ArrayNodePb) Size() (n int) + func (m *ArrayNodePb) String() string + func (m *ArrayNodePb) Unmarshal(data []byte) error + type BinaryNode struct + Args []Node + Operator lex.Token + Paren bool + func NewBinaryNode(operator lex.Token, lhArg, rhArg Node) *BinaryNode + func (m *BinaryNode) ChildrenArgs() []Node + func (m *BinaryNode) Equal(n Node) bool + func (m *BinaryNode) Expr() *Expr + func (m *BinaryNode) FromExpr(e *Expr) error + func (m *BinaryNode) FromPB(n *NodePb) Node + func (m *BinaryNode) NodePb() *NodePb + func (m *BinaryNode) NodeType() string + func (m *BinaryNode) String() string + func (m *BinaryNode) Validate() error + func (m *BinaryNode) WriteDialect(w DialectWriter) + type BinaryNodePb struct + Args []NodePb + Op int32 + Paren bool + XXX_unrecognized []byte + func (*BinaryNodePb) Descriptor() ([]byte, []int) + func (*BinaryNodePb) ProtoMessage() + func (m *BinaryNodePb) Marshal() (data []byte, err error) + func (m *BinaryNodePb) MarshalTo(data []byte) (int, error) + func (m *BinaryNodePb) Reset() + func (m *BinaryNodePb) Size() (n int) + func (m *BinaryNodePb) String() string + func (m *BinaryNodePb) Unmarshal(data []byte) error + type BooleanNode struct + Args []Node + Operator lex.Token + func NewBooleanNode(operator lex.Token, args ...Node) *BooleanNode + func (m *BooleanNode) ChildrenArgs() []Node + func (m *BooleanNode) Collapse() Node + func (m *BooleanNode) Equal(n Node) bool + func (m *BooleanNode) Expr() *Expr + func (m *BooleanNode) FromExpr(e *Expr) error + func (m *BooleanNode) FromPB(n *NodePb) Node + func (m *BooleanNode) Negated() bool + func (m *BooleanNode) NodePb() *NodePb + func (m *BooleanNode) NodeType() string + func (m *BooleanNode) ReverseNegation() bool + func (m *BooleanNode) String() string + func (m *BooleanNode) StringNegate() string + func (m *BooleanNode) Validate() error + func (m *BooleanNode) WriteDialect(w DialectWriter) + func (m *BooleanNode) WriteNegate(w DialectWriter) + type BooleanNodePb struct + Args []NodePb + Op int32 + XXX_unrecognized []byte + func (*BooleanNodePb) Descriptor() ([]byte, []int) + func (*BooleanNodePb) ProtoMessage() + func (m *BooleanNodePb) Marshal() (data []byte, err error) + func (m *BooleanNodePb) MarshalTo(data []byte) (int, error) + func (m *BooleanNodePb) Reset() + func (m *BooleanNodePb) Size() (n int) + func (m *BooleanNodePb) String() string + func (m *BooleanNodePb) Unmarshal(data []byte) error + type ContextReadWriter interface + type ContextReader interface + Get func(key string) (value.Value, bool) + Row func() map[string]value.Value + Ts func() time.Time + type ContextWriter interface + Delete func(row map[string]value.Value) error + Put func(col SchemaInfo, readCtx ContextReader, v value.Value) error + type CustomFunc interface + Type func() value.ValueType + Validate func(n *FuncNode) (EvaluatorFunc, error) + type DialectWriter interface + Len func() int + String func() string + WriteIdentity func(string) + WriteIdentityQuote func(string, byte) + WriteLeftRightIdentity func(string, string) + WriteLiteral func(string) + WriteNull func() + WriteNumber func(string) + WriteValue func(v value.Value) + func NewDefaultNoNamspaceWriter() DialectWriter + func NewDefaultWriter() DialectWriter + func NewDialectWriter(l, i byte) DialectWriter + func NewFingerPrintWriter(replace string, w DialectWriter) DialectWriter + func NewFingerPrinter() DialectWriter + func NewJSONDialectWriter() DialectWriter + func NewKeywordDialect(kw []string) DialectWriter + type EvalContext interface + type EvalIncludeContext interface + type EvaluatorFunc func(ctx EvalContext, args []value.Value) (value.Value, bool) + type Expr struct + Args []*Expr + Identity string + Op string + Value string + func ExprsFromNodes(nodes []Node) []*Expr + type ExprPb struct + Args []*ExprPb + Bval *bool + Fval *float64 + Ident *string + Ival *int64 + Op *int32 + Val *string + XXX_unrecognized []byte + func (*ExprPb) Descriptor() ([]byte, []int) + func (*ExprPb) ProtoMessage() + func (m *ExprPb) Marshal() (data []byte, err error) + func (m *ExprPb) MarshalTo(data []byte) (int, error) + func (m *ExprPb) Reset() + func (m *ExprPb) Size() (n int) + func (m *ExprPb) String() string + func (m *ExprPb) Unmarshal(data []byte) error + type Func struct + Aggregate bool + Eval EvaluatorFunc + Name string + type FuncNode struct + Args []Node + Eval EvaluatorFunc + F Func + Missing bool + Name string + func NewFuncNode(name string, f Func) *FuncNode + func (m *FuncNode) ChildrenArgs() []Node + func (m *FuncNode) Equal(n Node) bool + func (m *FuncNode) Expr() *Expr + func (m *FuncNode) FromExpr(e *Expr) error + func (m *FuncNode) FromPB(n *NodePb) Node + func (m *FuncNode) NodePb() *NodePb + func (m *FuncNode) NodeType() string + func (m *FuncNode) String() string + func (m *FuncNode) Validate() error + func (m *FuncNode) WriteDialect(w DialectWriter) + type FuncNodePb struct + Args []NodePb + Name string + XXX_unrecognized []byte + func (*FuncNodePb) Descriptor() ([]byte, []int) + func (*FuncNodePb) ProtoMessage() + func (m *FuncNodePb) Marshal() (data []byte, err error) + func (m *FuncNodePb) MarshalTo(data []byte) (int, error) + func (m *FuncNodePb) Reset() + func (m *FuncNodePb) Size() (n int) + func (m *FuncNodePb) String() string + func (m *FuncNodePb) Unmarshal(data []byte) error + type FuncRegistry struct + func NewFuncRegistry() *FuncRegistry + func (m *FuncRegistry) Add(name string, fn CustomFunc) + func (m *FuncRegistry) FuncGet(name string) (Func, bool) + type FuncResolver interface + FuncGet func(name string) (Func, bool) + type IdentityNode struct + Quote byte + Text string + func NewIdentityNode(tok *lex.Token) *IdentityNode + func NewIdentityNodeVal(val string) *IdentityNode + func (m *IdentityNode) Bool() bool + func (m *IdentityNode) Equal(n Node) bool + func (m *IdentityNode) Expr() *Expr + func (m *IdentityNode) FromExpr(e *Expr) error + func (m *IdentityNode) FromPB(n *NodePb) Node + func (m *IdentityNode) HasLeftRight() bool + func (m *IdentityNode) IdentityPb() *IdentityNodePb + func (m *IdentityNode) IsBooleanIdentity() bool + func (m *IdentityNode) LeftRight() (string, string, bool) + func (m *IdentityNode) NodePb() *NodePb + func (m *IdentityNode) NodeType() string + func (m *IdentityNode) OriginalText() string + func (m *IdentityNode) String() string + func (m *IdentityNode) Validate() error + func (m *IdentityNode) WriteDialect(w DialectWriter) + type IdentityNodePb struct + Quote *int32 + Text string + XXX_unrecognized []byte + func (*IdentityNodePb) Descriptor() ([]byte, []int) + func (*IdentityNodePb) ProtoMessage() + func (m *IdentityNodePb) Marshal() (data []byte, err error) + func (m *IdentityNodePb) MarshalTo(data []byte) (int, error) + func (m *IdentityNodePb) Reset() + func (m *IdentityNodePb) Size() (n int) + func (m *IdentityNodePb) String() string + func (m *IdentityNodePb) Unmarshal(data []byte) error + type IdentityNodes []*IdentityNode + func FindAllIdentities(node Node) IdentityNodes + func (m IdentityNodes) LeftStrings() []string + func (m IdentityNodes) Strings() []string + type IncludeContext struct + func NewIncludeContext(cr ContextReader) *IncludeContext + func (*IncludeContext) Include(name string) (Node, error) + type IncludeNode struct + ExprNode Node + Identity *IdentityNode + Operator lex.Token + func NewInclude(operator lex.Token, id *IdentityNode) *IncludeNode + func (m *IncludeNode) Collapse() Node + func (m *IncludeNode) Equal(n Node) bool + func (m *IncludeNode) Expr() *Expr + func (m *IncludeNode) FromExpr(e *Expr) error + func (m *IncludeNode) FromPB(n *NodePb) Node + func (m *IncludeNode) Negated() bool + func (m *IncludeNode) NodePb() *NodePb + func (m *IncludeNode) NodeType() string + func (m *IncludeNode) ReverseNegation() bool + func (m *IncludeNode) String() string + func (m *IncludeNode) StringNegate() string + func (m *IncludeNode) Validate() error + func (m *IncludeNode) WriteDialect(w DialectWriter) + func (m *IncludeNode) WriteNegate(w DialectWriter) + type IncludeNodePb struct + Identity IdentityNodePb + Negated bool + Op int32 + XXX_unrecognized []byte + func (*IncludeNodePb) Descriptor() ([]byte, []int) + func (*IncludeNodePb) ProtoMessage() + func (m *IncludeNodePb) Marshal() (data []byte, err error) + func (m *IncludeNodePb) MarshalTo(data []byte) (int, error) + func (m *IncludeNodePb) Reset() + func (m *IncludeNodePb) Size() (n int) + func (m *IncludeNodePb) String() string + func (m *IncludeNodePb) Unmarshal(data []byte) error + type Includer interface + Include func(name string) (Node, error) + type LexTokenPager struct + func NewLexTokenPager(lex *lex.Lexer) *LexTokenPager + func (m *LexTokenPager) Backup() + func (m *LexTokenPager) ClauseEnd() bool + func (m *LexTokenPager) Cur() lex.Token + func (m *LexTokenPager) ErrMsg(msg string) error + func (m *LexTokenPager) IsEnd() bool + func (m *LexTokenPager) Lexer() *lex.Lexer + func (m *LexTokenPager) Next() lex.Token + func (m *LexTokenPager) Peek() lex.Token + type NegateableNode interface + Collapse func() Node + Negated func() bool + ReverseNegation func() bool + StringNegate func() string + WriteNegate func(w DialectWriter) + type Node interface + Equal func(Node) bool + Expr func() *Expr + FromExpr func(*Expr) error + FromPB func(*NodePb) Node + NodePb func() *NodePb + NodeType func() string + String func() string + Validate func() error + WriteDialect func(w DialectWriter) + func InlineIncludes(ctx Includer, n Node) (Node, error) + func MustParse(expressionText string) Node + func NewUnary(operator lex.Token, arg Node) Node + func NodeFromExpr(e *Expr) (Node, error) + func NodeFromNodePb(n *NodePb) Node + func NodeFromPb(pb []byte) (Node, error) + func NodesFromExprs(args []*Expr) ([]Node, error) + func NodesFromNodesPb(pb []NodePb) []Node + func NodesFromNodesPbPtr(pb []*NodePb) []Node + func ParseExprWithFuncs(p TokenPager, fr FuncResolver) (Node, error) + func ParseExpression(expressionText string) (Node, error) + func ParsePager(pager TokenPager) (Node, error) + type NodeArgs interface + ChildrenArgs func() []Node + type NodePb struct + An *ArrayNodePb + Bn *BinaryNodePb + Booln *BooleanNodePb + Fn *FuncNodePb + In *IdentityNodePb + Incn *IncludeNodePb + Niln *NullNodePb + Nn *NumberNodePb + Sn *StringNodePb + Tn *TriNodePb + Un *UnaryNodePb + Vn *ValueNodePb + XXX_unrecognized []byte + func NodesPbFromNodes(nodes []Node) []*NodePb + func (*NodePb) Descriptor() ([]byte, []int) + func (*NodePb) ProtoMessage() + func (m *NodePb) Marshal() (data []byte, err error) + func (m *NodePb) MarshalTo(data []byte) (int, error) + func (m *NodePb) Reset() + func (m *NodePb) Size() (n int) + func (m *NodePb) String() string + func (m *NodePb) Unmarshal(data []byte) error + type NullNode struct + func NewNull(operator lex.Token) *NullNode + func (m *NullNode) Equal(n Node) bool + func (m *NullNode) Expr() *Expr + func (m *NullNode) FromExpr(e *Expr) error + func (m *NullNode) FromPB(n *NodePb) Node + func (m *NullNode) NodePb() *NodePb + func (m *NullNode) NodeType() string + func (m *NullNode) String() string + func (m *NullNode) Validate() error + func (m *NullNode) WriteDialect(w DialectWriter) + type NullNodePb struct + Niltype int32 + XXX_unrecognized []byte + func (*NullNodePb) Descriptor() ([]byte, []int) + func (*NullNodePb) ProtoMessage() + func (m *NullNodePb) Marshal() (data []byte, err error) + func (m *NullNodePb) MarshalTo(data []byte) (int, error) + func (m *NullNodePb) Reset() + func (m *NullNodePb) Size() (n int) + func (m *NullNodePb) String() string + func (m *NullNodePb) Unmarshal(data []byte) error + type NumberNode struct + Float64 float64 + Int64 int64 + IsFloat bool + IsInt bool + Text string + func NewNumber(fv float64) (*NumberNode, error) + func NewNumberStr(text string) (*NumberNode, error) + func (m *NumberNode) Equal(n Node) bool + func (m *NumberNode) Expr() *Expr + func (m *NumberNode) FromExpr(e *Expr) error + func (m *NumberNode) FromPB(n *NodePb) Node + func (m *NumberNode) NodePb() *NodePb + func (m *NumberNode) NodeType() string + func (m *NumberNode) Validate() error + func (m *NumberNode) WriteDialect(w DialectWriter) + func (n *NumberNode) String() string + type NumberNodePb struct + Fv float64 + Isfloat bool + Isint bool + Iv int64 + Text string + XXX_unrecognized []byte + func (*NumberNodePb) Descriptor() ([]byte, []int) + func (*NumberNodePb) ProtoMessage() + func (m *NumberNodePb) Marshal() (data []byte, err error) + func (m *NumberNodePb) MarshalTo(data []byte) (int, error) + func (m *NumberNodePb) Reset() + func (m *NumberNodePb) Size() (n int) + func (m *NumberNodePb) String() string + func (m *NumberNodePb) Unmarshal(data []byte) error + type RowWriter interface + Commit func(rowInfo []SchemaInfo, row RowWriter) error + Put func(col SchemaInfo, readCtx ContextReader, v value.Value) error + type SchemaInfo interface + Key func() string + type SchemaInfoString string + func (m SchemaInfoString) Key() string + type StringNode struct + Quote byte + Text string + func NewStringNeedsEscape(t lex.Token) *StringNode + func NewStringNoQuoteNode(text string) *StringNode + func NewStringNode(text string) *StringNode + func NewStringNodeToken(t lex.Token) *StringNode + func (m *StringNode) Equal(n Node) bool + func (m *StringNode) Expr() *Expr + func (m *StringNode) FromExpr(e *Expr) error + func (m *StringNode) FromPB(n *NodePb) Node + func (m *StringNode) NodePb() *NodePb + func (m *StringNode) NodeType() string + func (m *StringNode) String() string + func (m *StringNode) Validate() error + func (m *StringNode) WriteDialect(w DialectWriter) + type StringNodePb struct + Noquote *bool + Quote *int32 + Text string + XXX_unrecognized []byte + func (*StringNodePb) Descriptor() ([]byte, []int) + func (*StringNodePb) ProtoMessage() + func (m *StringNodePb) Marshal() (data []byte, err error) + func (m *StringNodePb) MarshalTo(data []byte) (int, error) + func (m *StringNodePb) Reset() + func (m *StringNodePb) Size() (n int) + func (m *StringNodePb) String() string + func (m *StringNodePb) Unmarshal(data []byte) error + type TokenPager interface + Backup func() + ClauseEnd func() bool + Cur func() lex.Token + ErrMsg func(msg string) error + IsEnd func() bool + Lexer func() *lex.Lexer + Next func() lex.Token + Peek func() lex.Token + type TriNode struct + Args []Node + Operator lex.Token + func NewTriNode(operator lex.Token, arg1, arg2, arg3 Node) *TriNode + func (m *TriNode) ChildrenArgs() []Node + func (m *TriNode) Collapse() Node + func (m *TriNode) Equal(n Node) bool + func (m *TriNode) Expr() *Expr + func (m *TriNode) FromExpr(e *Expr) error + func (m *TriNode) FromPB(n *NodePb) Node + func (m *TriNode) Negated() bool + func (m *TriNode) NodePb() *NodePb + func (m *TriNode) NodeType() string + func (m *TriNode) ReverseNegation() bool + func (m *TriNode) String() string + func (m *TriNode) StringNegate() string + func (m *TriNode) Validate() error + func (m *TriNode) WriteDialect(w DialectWriter) + func (m *TriNode) WriteNegate(w DialectWriter) + type TriNodePb struct + Args []NodePb + Op int32 + XXX_unrecognized []byte + func (*TriNodePb) Descriptor() ([]byte, []int) + func (*TriNodePb) ProtoMessage() + func (m *TriNodePb) Marshal() (data []byte, err error) + func (m *TriNodePb) MarshalTo(data []byte) (int, error) + func (m *TriNodePb) Reset() + func (m *TriNodePb) Size() (n int) + func (m *TriNodePb) String() string + func (m *TriNodePb) Unmarshal(data []byte) error + type UnaryNode struct + Arg Node + Operator lex.Token + func (m *UnaryNode) ChildrenArgs() []Node + func (m *UnaryNode) Collapse() Node + func (m *UnaryNode) Equal(n Node) bool + func (m *UnaryNode) Expr() *Expr + func (m *UnaryNode) FromExpr(e *Expr) error + func (m *UnaryNode) FromPB(n *NodePb) Node + func (m *UnaryNode) NodePb() *NodePb + func (m *UnaryNode) NodeType() string + func (m *UnaryNode) String() string + func (m *UnaryNode) Validate() error + func (m *UnaryNode) WriteDialect(w DialectWriter) + type UnaryNodePb struct + Arg NodePb + Op int32 + Paren bool + XXX_unrecognized []byte + func (*UnaryNodePb) Descriptor() ([]byte, []int) + func (*UnaryNodePb) ProtoMessage() + func (m *UnaryNodePb) Marshal() (data []byte, err error) + func (m *UnaryNodePb) MarshalTo(data []byte) (int, error) + func (m *UnaryNodePb) Reset() + func (m *UnaryNodePb) Size() (n int) + func (m *UnaryNodePb) String() string + func (m *UnaryNodePb) Unmarshal(data []byte) error + type ValueNode struct + Value value.Value + func NewValueNode(val value.Value) *ValueNode + func (m *ValueNode) Equal(n Node) bool + func (m *ValueNode) Expr() *Expr + func (m *ValueNode) FromExpr(e *Expr) error + func (m *ValueNode) FromPB(n *NodePb) Node + func (m *ValueNode) IsArray() bool + func (m *ValueNode) NodePb() *NodePb + func (m *ValueNode) NodeType() string + func (m *ValueNode) String() string + func (m *ValueNode) Validate() error + func (m *ValueNode) WriteDialect(w DialectWriter) + type ValueNodePb struct + Value []byte + Valuetype int32 + XXX_unrecognized []byte + func (*ValueNodePb) Descriptor() ([]byte, []int) + func (*ValueNodePb) ProtoMessage() + func (m *ValueNodePb) Marshal() (data []byte, err error) + func (m *ValueNodePb) MarshalTo(data []byte) (int, error) + func (m *ValueNodePb) Reset() + func (m *ValueNodePb) Size() (n int) + func (m *ValueNodePb) String() string + func (m *ValueNodePb) Unmarshal(data []byte) error