Documentation ¶
Index ¶
- Variables
- func CompareSatisfies(refop, op CompareOperator, cmp int) (res bool)
- type AndCondition
- type Array
- type Boolean
- type Compare
- type CompareOperator
- type CompositeOperator
- type Condition
- type ConditionOperand
- type ConditionRHS
- type Contains
- type Expression
- type FilterCondOptions
- type FilterConditionOption
- type Is
- type Map
- type MapEntry
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Eq = CompareOperator("=") Neq = CompareOperator("!=") Gt = CompareOperator(">") Gte = CompareOperator(">=") Lt = CompareOperator("<") Lte = CompareOperator("<=") OR = CompositeOperator("OR") AND = CompositeOperator("AND") )
Functions ¶
func CompareSatisfies ¶
func CompareSatisfies(refop, op CompareOperator, cmp int) (res bool)
Types ¶
type AndCondition ¶
type AndCondition struct {
Or []Condition `@@ { [("AND" | "+" )] @@ }`
}
type Compare ¶
type Compare struct { Operator CompareOperator `@CompareOperator` Value Value `@@` }
type CompareOperator ¶
type CompareOperator string
func (*CompareOperator) Capture ¶
func (op *CompareOperator) Capture(values []string) error
func (*CompareOperator) MatchCompareResult ¶
func (op *CompareOperator) MatchCompareResult(cmp int) bool
type CompositeOperator ¶
type CompositeOperator string
type Condition ¶
type Condition struct { Not *Condition ` "NOT" @@` SubExpression *Expression `| "(" @@ ")"` Operand *ConditionOperand `| @@` }
type ConditionOperand ¶
type ConditionOperand struct { FieldPath string `@FieldPath` ConditionRHS ConditionRHS `@@ ` }
type ConditionRHS ¶
type ConditionRHS struct { Compare *Compare ` @@` Is *Is `| "IS" @@` In Array `| "IN" ("(" @@ { "," @@ } ")" | "[" @@ { "," @@ } "]")` NotIn Array `| "NOT" "IN" ("(" @@ { "," @@ } ")" | "[" @@ { "," @@ } "]")` Contains *Contains `| ("CONTAINS" | "HAS") @@` Like *string `| "LIKE" @String` }
func (ConditionRHS) JSONValue ¶
func (crhs ConditionRHS) JSONValue() ([]byte, error)
type Contains ¶
type Expression ¶
type Expression struct {
And []AndCondition `@@ { ("OR" | "|") @@ }`
}
func Parse ¶
func Parse(data []byte) (*Expression, error)
type FilterCondOptions ¶
type FilterCondOptions interface {
IsNot() bool
}
func MakeFilterCondOptions ¶
func MakeFilterCondOptions(opts []FilterConditionOption) FilterCondOptions
type FilterConditionOption ¶
type FilterConditionOption func(*condOptionsCfg)
func Not ¶
func Not() FilterConditionOption
Click to show internal directories.
Click to hide internal directories.