Documentation ¶
Index ¶
- Constants
- func Between(key string, expression, expression2 string) *between
- func BetweenInclusive(key string, expression, expression2 string) *betweenInclusive
- func Contains(key string, expression string) *contains
- func ContainsIgnoreCase(key string, expression string) *containsIgnoreCase
- func EqualIgnoreCase(key string, expression string) *equalsIgnoreCase
- func Equals(key string, expression string) *equals
- func GreaterOrEqualThan(key string, expression string) *greaterOrEqualThan
- func GreaterThan(key string, expression string) *greaterThan
- func LowerOrEqualThan(key string, expression string) *lowerOrEqualThan
- func LowerThan(key string, expression string) *lowerThan
- func MatchesRegex(key string, expression string) *matchRegex
- func NotEquals(key string, expression string) *notEquals
- type Condition
- type ConditionElement
- type Expression
- type Filter
- type GlobalToken
- type LogicalOperator
- type OpTerm
- type OpValue
- type Operation
- type Predicate
- type Term
- type Value
Constants ¶
View Source
const ( OpEquals = Operation("OpEquals") OpEqualsIgnoreCase = Operation("OpEqualsIgnoreCase") OpNotEqual = Operation("OpNotEqual") OpEqualIgnoreCase = Operation("OpEqualIgnoreCase") OpContains = Operation("OpContains") OpContainsIgnoreCase = Operation("OpContainsIgnoreCase") OpLowerThan = Operation("OpLowerThan") OpGreaterThan = Operation("OpGreaterThan") OpLowerOrEqualThan = Operation("OpLowerOrEqualThan") OpGreaterOrEqualThan = Operation("OpGreaterOrEqualThan") OpMatchesRegex = Operation("OpMatchesRegex") OpBetween = Operation("OpBetween") OpBetweenInclusive = Operation("OpBetweenInclusive") )
Variables ¶
This section is empty.
Functions ¶
func BetweenInclusive ¶
func ContainsIgnoreCase ¶
func EqualIgnoreCase ¶
func GreaterOrEqualThan ¶
func GreaterThan ¶
func LowerOrEqualThan ¶
func MatchesRegex ¶
Types ¶
type Condition ¶
type ConditionElement ¶
type ConditionElement struct { Condition *Condition ` @@` GlobalToken *GlobalToken `| @@ ` Subexpression *Expression `| "(" @@ ")"` }
type Expression ¶
func ParseFilterExpression ¶
func ParseFilterExpression(exp string) (*Expression, error)
type GlobalToken ¶ added in v0.2.12
type GlobalToken struct {
String *string `@String`
}
type LogicalOperator ¶
type LogicalOperator int
const ( And LogicalOperator = iota Or )
func (LogicalOperator) Apply ¶
func (c LogicalOperator) Apply(l, r bool) bool
func (*LogicalOperator) Capture ¶
func (o *LogicalOperator) Capture(s []string) error
type OpTerm ¶
type OpTerm struct { Operator LogicalOperator `@("OR")` Term *Term `@@` }
type OpValue ¶
type OpValue struct { Operator LogicalOperator `@("AND")` ConditionElement *ConditionElement `@@` }
type Predicate ¶
type Predicate struct { KeyName string `json:"key" yaml:"key"` KeyExpression []string `json:"expression" yaml:"expression"` Operation Operation `json:"operation" yaml:"operation"` Right []Filter `json:"right,omitempty" yaml:"right"` }
func (*Predicate) Expression ¶
type Term ¶
type Term struct { Left *ConditionElement `@@` Right []*OpValue `@@*` }
Click to show internal directories.
Click to hide internal directories.