operator

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type Evaluator = expr.Evaluator

Evaluator provides the evaluation function for an expression operator.

func And

func And(left, right Evaluator) Evaluator

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

func Not(evaluator Evaluator) Evaluator

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

func Or(left, right Evaluator) Evaluator

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL