operators

package
v0.27.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0, BSD-3-Clause Imports: 0 Imported by: 1 module, 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 operators defines the internal function names of operators.

All operators in the expression language are modelled as function calls.

Index

Constants

View Source
const (
	// Symbolic operators.
	Conditional   = "_?_:_"
	LogicalAnd    = "_&&_"
	LogicalOr     = "_||_"
	LogicalNot    = "!_"
	Equals        = "_==_"
	NotEquals     = "_!=_"
	Less          = "_<_"
	LessEquals    = "_<=_"
	Greater       = "_>_"
	GreaterEquals = "_>=_"
	Add           = "_+_"
	Subtract      = "_-_"
	Multiply      = "_*_"
	Divide        = "_/_"
	Modulo        = "_%_"
	Negate        = "-_"
	Index         = "_[_]"
	OptIndex      = "_[?_]"
	OptSelect     = "_?._"

	// Macros, must have a valid identifier.
	Has       = "has"
	All       = "all"
	Exists    = "exists"
	ExistsOne = "exists_one"
	Map       = "map"
	Filter    = "filter"

	// Named operators, must not have be valid identifiers.
	NotStrictlyFalse = "@not_strictly_false"
	In               = "@in"

	// Deprecated: named operators with valid identifiers.
	OldNotStrictlyFalse = "__not_strictly_false__"
	OldIn               = "_in_"
)

String "names" for CEL operators.

Variables

This section is empty.

Functions

func Arity added in v0.27.0

func Arity(symbol string) int

Arity returns the number of argument the operator takes -1 is returned if an undefined symbol is provided

func Find

func Find(text string) (string, bool)

Find the internal function name for an operator, if the input text is one.

func FindReverse added in v0.27.0

func FindReverse(symbol string) (string, bool)

FindReverse returns the unmangled, text representation of the operator.

func FindReverseBinaryOperator added in v0.27.0

func FindReverseBinaryOperator(symbol string) (string, bool)

FindReverseBinaryOperator returns the unmangled, text representation of a binary operator.

If the symbol does refer to an operator, but the operator does not have a display name the result is false.

func Precedence added in v0.27.0

func Precedence(symbol string) int

Precedence returns the operator precedence, where the higher the number indicates higher precedence operations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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