Documentation ¶
Index ¶
- Constants
- func EvaluateQuery(env utils.Environment, query *ContactQuery, queryable Queryable) (bool, error)
- func NewErrorListener() *errorListener
- type BoolCombination
- type Condition
- type ContactQuery
- type QueryNode
- type Queryable
- type Visitor
- func (v *Visitor) Visit(tree antlr.ParseTree) interface{}
- func (v *Visitor) VisitCombinationAnd(ctx *gen.CombinationAndContext) interface{}
- func (v *Visitor) VisitCombinationImpicitAnd(ctx *gen.CombinationImpicitAndContext) interface{}
- func (v *Visitor) VisitCombinationOr(ctx *gen.CombinationOrContext) interface{}
- func (v *Visitor) VisitCondition(ctx *gen.ConditionContext) interface{}
- func (v *Visitor) VisitExpressionGrouping(ctx *gen.ExpressionGroupingContext) interface{}
- func (v *Visitor) VisitImplicitCondition(ctx *gen.ImplicitConditionContext) interface{}
- func (v *Visitor) VisitParse(ctx *gen.ParseContext) interface{}
- func (v *Visitor) VisitStringLiteral(ctx *gen.StringLiteralContext) interface{}
- func (v *Visitor) VisitTextLiteral(ctx *gen.TextLiteralContext) interface{}
Constants ¶
View Source
const (
ImplicitKey string = "*"
)
Variables ¶
This section is empty.
Functions ¶
func EvaluateQuery ¶
func EvaluateQuery(env utils.Environment, query *ContactQuery, queryable Queryable) (bool, error)
func NewErrorListener ¶ added in v0.6.2
func NewErrorListener() *errorListener
Types ¶
type BoolCombination ¶
type BoolCombination struct {
// contains filtered or unexported fields
}
BoolCombination is a AND or OR combination of multiple conditions
func NewBoolCombination ¶
func NewBoolCombination(op boolOp, children ...QueryNode) *BoolCombination
NewBoolCombination creates a new boolean combination
func (*BoolCombination) Evaluate ¶
func (b *BoolCombination) Evaluate(env utils.Environment, queryable Queryable) (bool, error)
Evaluate returns whether this combination evaluates to true or false
func (*BoolCombination) String ¶
func (b *BoolCombination) String() string
type Condition ¶
type Condition struct {
// contains filtered or unexported fields
}
Condition represents a comparison between a keywed value on the contact and a provided value
type ContactQuery ¶
type ContactQuery struct {
// contains filtered or unexported fields
}
func ParseQuery ¶
func ParseQuery(text string) (*ContactQuery, error)
func (*ContactQuery) Evaluate ¶
func (q *ContactQuery) Evaluate(env utils.Environment, queryable Queryable) (bool, error)
func (*ContactQuery) String ¶
func (q *ContactQuery) String() string
type Visitor ¶
type Visitor struct {
gen.BaseContactQLVisitor
}
func (*Visitor) VisitCombinationAnd ¶
func (v *Visitor) VisitCombinationAnd(ctx *gen.CombinationAndContext) interface{}
expression : expression AND expression
func (*Visitor) VisitCombinationImpicitAnd ¶
func (v *Visitor) VisitCombinationImpicitAnd(ctx *gen.CombinationImpicitAndContext) interface{}
expression : expression expression
func (*Visitor) VisitCombinationOr ¶
func (v *Visitor) VisitCombinationOr(ctx *gen.CombinationOrContext) interface{}
expression : expression OR expression
func (*Visitor) VisitCondition ¶
func (v *Visitor) VisitCondition(ctx *gen.ConditionContext) interface{}
expression : TEXT COMPARATOR literal
func (*Visitor) VisitExpressionGrouping ¶
func (v *Visitor) VisitExpressionGrouping(ctx *gen.ExpressionGroupingContext) interface{}
expression : LPAREN expression RPAREN
func (*Visitor) VisitImplicitCondition ¶
func (v *Visitor) VisitImplicitCondition(ctx *gen.ImplicitConditionContext) interface{}
expression : TEXT
func (*Visitor) VisitParse ¶
func (v *Visitor) VisitParse(ctx *gen.ParseContext) interface{}
parse: expression
func (*Visitor) VisitStringLiteral ¶
func (v *Visitor) VisitStringLiteral(ctx *gen.StringLiteralContext) interface{}
literal : STRING
func (*Visitor) VisitTextLiteral ¶
func (v *Visitor) VisitTextLiteral(ctx *gen.TextLiteralContext) interface{}
literal : TEXT
Click to show internal directories.
Click to hide internal directories.