Documentation
¶
Overview ¶
Package operator provides the small predicate expression language.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Evaluator ¶
Evaluator provides the evaluation function for an expression operator.
func And ¶
And creates an evaluator that performs explicit logical AND with short-circuit evaluation. The evaluator implements the explicit logical AND operator. Both evaluators must yield for the result to be yielded. The right evaluator is only evaluated if the left evaluator yields (short-circuit evaluation). The expression pipeline already provides implicit AND semantics through juxtaposition, but this evaluator can be used for explicit AND operations.
func Not ¶
Not creates an evaluator that inverts the evaluation result of the given evaluator. The evaluator implements the unary NOT operator. It inverts the evaluation result: if the wrapped evaluator yields a value, the evaluator does not yield; if the wrapped evaluator does not yield, the evaluator yields the input value.
func Or ¶
Or creates an evaluator that performs logical OR with short-circuit evaluation. It evaluates the left evaluator first. If the left evaluator yields a value, the evaluator yields and does not evaluate the right evaluator. If the left evaluator does not yield, the right evaluator is evaluated.