Documentation ¶
Overview ¶
Package builder is used to construct predicate expressions using builder functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AndExpr ¶
type AndExpr struct { // Left is a left argument of && operator expression Left Expr // Right is a right argument of && operator expression Right Expr }
AndExpr returns && expression.
type ContainsExpr ¶
type ContainsExpr struct { // Left is a left argument of Contains expression Left Expr // Right is a right argument of Contains expression Right Expr }
ContainsExpr constructs function expression used in rules specifications that checks if one value contains the other, e.g. contains([]string{"a"}, "b") where left is []string{"a"} and right is "b".
func Contains ¶
func Contains(a, b Expr) ContainsExpr
Contains returns contains function call expression.
func (ContainsExpr) String ¶
func (i ContainsExpr) String() string
String returns function call expression used in rules.
type EqualsExpr ¶
type EqualsExpr struct { // Left is a left argument of Equals expression Left Expr // Value to check Right Expr }
EqualsExpr constructs function expression used in rules specifications that checks if one value is equal to another e.g. equals("a", "b") where Left is "a" and right is "b".
func (EqualsExpr) String ¶
func (i EqualsExpr) String() string
String returns function call expression used in rules.
type Expr ¶
type Expr interface { // String serializes expression into format parsed by rules engine // (golang based syntax) String() string }
Expr is an expression builder, used to create expressions in rules definitions.
type IdentifierExpr ¶
type IdentifierExpr string
IdentifierExpr is identifier expression.
func Identifier ¶
func Identifier(v string) IdentifierExpr
Identifier returns identifier expression.
func (IdentifierExpr) String ¶
func (i IdentifierExpr) String() string
String serializes identifier expression into format parsed by rules engine.
type NotExpr ¶
type NotExpr struct { // Expr is an expression to negate Expr Expr }
NotExpr constructs function expression used in rules specifications that negates the result of the boolean predicate e.g. ! equals"a", "b") where Left is "a" and right is "b".
type OrExpr ¶
type OrExpr struct { // Left is a left argument of || operator expression Left Expr // Right is a right argument of || operator expression Right Expr }
OrExpr returns || expression.
type StringExpr ¶
type StringExpr string
StringExpr is a string expression.
func (StringExpr) String ¶
func (s StringExpr) String() string
type StringsExpr ¶
type StringsExpr []string
StringsExpr is a slice of strings.
func (StringsExpr) String ¶
func (s StringsExpr) String() string