Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cel-expr/cel-go
/ functions
Functions
9,178 in github.com/cel-expr/cel-go
⨍
Functions
9,178
◇
Types & classes
1,189
↓ 367 callers
Method
Err
Err returns an error value if the issues list contains one or more errors.
cel/env.go:1206
↓ 290 callers
Method
Error
()
common/runes/buffer.go:123
↓ 287 callers
Method
Eval
Eval returns the result of an evaluation of the Ast and environment against the input vars. The vars value may either be an `Activation` or a `map[st
cel/program.go:50
↓ 274 callers
Method
Equal
Equal returns true if the `other` value has the same type and content as the implementing struct.
common/types/ref/reference.go:55
↓ 268 callers
Method
Kind
Kind of the expression node. See ExprKind for the valid enum values.
common/ast/expr.go:62
↓ 259 callers
Method
Program
Program generates an evaluable instance of the Ast within the environment (Env).
cel/env.go:788
↓ 252 callers
Function
NewEnv
NewEnv creates a program environment configured with the standard library of CEL functions and macros. The Env value returned can parse and check any
cel/env.go:424
↓ 242 callers
Function
Variable
Variable creates an instance of a variable declaration with a variable name and type.
cel/decls.go:144
↓ 232 callers
Method
Contains
Contains returns true if the value exists within the object.
common/types/traits/container.go:22
↓ 182 callers
Method
ID
ID of the expression as it appears in the AST
common/ast/expr.go:59
↓ 164 callers
Method
NativeToValue
NativeToValue converts the input `value` to a CEL `ref.Val`.
common/types/ref/provider.go:56
↓ 156 callers
Method
New
New returns a mutable proto message
common/types/pb/type.go:144
↓ 148 callers
Method
Compile
()
repl/parser/commands_parser.go:533
↓ 148 callers
Method
Value
Value returns the map entry value expression.
common/ast/expr.go:230
↓ 147 callers
Function
IsError
IsError returns whether the input element ref.Type or ref.Val is equal to the ErrType singleton.
common/types/err.go:171
↓ 136 callers
Method
ConvertToNative
ConvertToNative converts the Value to a native Go struct according to the reflected type description, or error if the conversion is not feasible. The
common/types/ref/reference.go:49
↓ 136 callers
Function
NoVars
NoVars returns an empty Activation.
cel/program.go:103
↓ 130 callers
Method
Compile
Compile combines the Parse and Check phases CEL program compilation to produce an Ast and associated issues. If an error is encountered during parsin
cel/env.go:563
↓ 113 callers
Method
Add
Add returns a combination of the current value and other value. If the other value is an unsupported type, an error is returned.
common/types/traits/math.go:24
↓ 113 callers
Function
newTestRegistry
(t *testing.T, opts ...RegistryOption)
common/types/provider_test.go:1514
↓ 108 callers
Method
Error
()
cel/async/async_test.go:34
↓ 105 callers
Function
NewErr
NewErr creates a new Err described by the format string and args. TODO: Audit the use of this function and standardize the error messages and codes.
common/types/err.go:61
↓ 98 callers
Method
String
String takes a ref.Val and a string representing the current locale identifier and returns the Val formatted as a string, or an error if one occurred.
ext/formatting.go:742
↓ 96 callers
Function
OptionalTypes
OptionalTypes enable support for optional syntax and types in CEL. The optional value type makes it possible to express whether variables have been p
cel/library.go:410
↓ 92 callers
Function
Function
Function defines a function and overloads with optional singleton or per-overload bindings. Using Function is roughly equivalent to calling Declarati
cel/decls.go:195
↓ 89 callers
Method
Type
Type returns the deduced type of the AstNode.
common/cost/estimator.go:51
↓ 89 callers
Function
testEnv
(t testing.TB, opts ...EnvOption)
cel/cel_test.go:5203
↓ 88 callers
Method
AsCall
AsCall adapts the expr into a CallExpr The Kind() must be equal to a CallKind for the conversion to be well-defined.
common/ast/expr.go:67
↓ 82 callers
Method
Expr
Expr returns the expression of the AstNode.
common/cost/estimator.go:54
↓ 80 callers
Method
TypeName
TypeName returns the struct type name.
common/ast/expr.go:242
↓ 76 callers
Method
Error
Error implements error.
ext/formatting.go:708
↓ 74 callers
Method
Get
Get the value at the specified index or error.
common/types/traits/indexer.go:24
↓ 74 callers
Function
Overload
Overload defines a new global overload with an overload id, argument types, and result type. Through the use of OverloadOpt options, the overload may
cel/decls.go:307
↓ 70 callers
Method
Get
(i int)
common/runes/buffer.go:26
↓ 70 callers
Method
Parse
()
repl/parser/commands_parser.go:534
↓ 62 callers
Function
FixedCostEstimate
FixedCostEstimate returns a cost with a fixed min and max range.
common/cost/cost.go:338
↓ 60 callers
Function
EvalCost
EvalCost sets the evaluation cost expression for the overload model.
common/cost/model.go:1099
↓ 60 callers
Function
NewExprFactory
NewExprFactory creates an ExprFactory instance.
common/ast/factory.go:89
↓ 60 callers
Method
ReportError
ReportError records an error at a source location.
common/errors.go:45
↓ 60 callers
Function
Types
Types adds one or more type declarations to the environment, allowing for construction of type-literals whose definitions are included in the common e
cel/options.go:381
↓ 59 callers
Method
Args
Args returns the list of call arguments, excluding the target.
common/ast/expr.go:173
↓ 59 callers
Function
EvalOptions
EvalOptions sets one or more evaluation options which may affect the evaluation or Result.
cel/options.go:798
↓ 59 callers
Function
FixedSizeEstimate
FixedSizeEstimate returns a size estimate with a fixed min and max range.
common/cost/cost.go:188
↓ 59 callers
Method
FunctionName
FunctionName returns the name of the function.
common/ast/expr.go:164
↓ 59 callers
Function
NewListType
NewListType creates an instances of a list type value with the provided element type.
common/types/types.go:506
↓ 59 callers
Method
NewLiteral
NewLiteral creates an Expr value representing a literal value, such as a string or integer.
common/ast/factory.go:50
↓ 58 callers
Method
GetError
()
parser/lexer.go:244
↓ 57 callers
Function
Const
Const creates a constant quantity expression.
common/cost/model.go:199
↓ 57 callers
Method
Name
Name returns the name of the field.
common/ast/expr.go:254
↓ 57 callers
Function
RangedSizeEstimate
RangedSizeEstimate returns a size estimate bounded by min and max.
common/cost/cost.go:193
↓ 56 callers
Method
AsLiteral
AsLiteral adapts the expr into a constant ref.Val. The Kind() must be equal to a LiteralKind for the conversion to be well-defined.
common/ast/expr.go:82
↓ 55 callers
Method
GetState
GetState retrieves the stateful metadata from the execution frame.
interpreter/interpreter.go:50
↓ 55 callers
Function
MaybeNoSuchOverloadErr
MaybeNoSuchOverloadErr returns the error or unknown if the input ref.Val is one of these types, else a new no such overload error.
common/types/err.go:101
↓ 54 callers
Method
Extend
Extend the current environment with additional options to produce a new Env. Note, the extended Env value should not share memory with the original.
cel/env.go:598
↓ 54 callers
Method
Recover
(recognizer antlr.Parser, e antlr.RecognitionException)
parser/antlr_parser.go:188
↓ 54 callers
Function
newTestRegistry
(t testing.TB, opts ...types.RegistryOption)
interpreter/interpreter_test.go:2814
↓ 53 callers
Method
AsIdent
AsIdent adapts the expr into an identifier string. The Kind() must be equal to an IdentKind for the conversion to be well-defined.
common/ast/expr.go:77
↓ 53 callers
Function
NewActivation
NewActivation returns an activation based on a map-based binding where the map keys are expected to be qualified names used with ResolveName calls. T
interpreter/activation.go:63
↓ 52 callers
Method
GetErrors
GetErrors returns the list of observed errors.
common/errors.go:69
↓ 52 callers
Function
NewTextSource
TODO(jimlarson) "Character offsets" should index the code points within the UTF-8 encoded string. It currently indexes bytes. Can be accomplished by
common/source.go:73
↓ 52 callers
Method
Value
Value returns the raw value of the instance which may not be directly compatible with the expression language types.
common/types/ref/reference.go:62
↓ 51 callers
Function
Arg
Arg creates an expression referencing the size of the argument at the given index.
common/cost/model.go:228
↓ 51 callers
Method
ID
ID where the qualifier appears within an expression.
interpreter/attributes.go:69
↓ 51 callers
Method
Len
()
common/runes/buffer.go:28
↓ 51 callers
Function
ProtoTypeDefs
ProtoTypeDefs creates a RegistryOption which registers the individual proto messages with the registry.
common/types/provider.go:131
↓ 50 callers
Method
AsList
AsList adapts the expr into a ListExpr. The Kind() must be equal to a ListKind for the conversion to be well-defined.
common/ast/expr.go:87
↓ 50 callers
Method
Check
Check performs type-checking on the input Ast and yields a checked Ast and/or set of Issues. If any `ASTValidators` are configured on the environment,
cel/env.go:481
↓ 50 callers
Function
NewAttributeFactory
NewAttributeFactory returns a default AttributeFactory which is produces Attribute values capable of resolving types by simple names and qualify the v
interpreter/attributes.go:146
↓ 49 callers
Method
NewIdent
NewIdent creates an Expr value representing an identifier.
common/ast/factory.go:40
↓ 48 callers
Method
Match
Match returns true if the pattern matches the current value.
common/types/traits/matcher.go:22
↓ 48 callers
Function
NewFunction
NewFunction creates a new function declaration with a set of function options to configure overloads and function definitions (implementations). Func
common/decls/decls.go:37
↓ 48 callers
Function
NewObjectType
NewObjectType creates a type reference to an externally defined type, e.g. a protobuf message type. An object type is assumed to support field presen
common/types/types.go:568
↓ 48 callers
Function
WrapErr
WrapErr wraps an existing Go error value into a CEL Err value.
common/types/err.go:115
↓ 47 callers
Function
CostTracking
CostTracking enables cost tracking and registers a ActualCostEstimator that can optionally provide a runtime cost estimate for any function calls.
cel/options.go:931
↓ 47 callers
Function
NewCustomEnv
NewCustomEnv creates a custom program environment which is not automatically configured with the standard library of functions and macros documented i
cel/env.go:447
↓ 47 callers
Function
NewVariable
NewVariable creates a new variable declaration.
common/decls/decls.go:1121
↓ 46 callers
Method
NewCall
NewCall creates an Expr value representing a global function call.
common/ast/factory.go:28
↓ 46 callers
Function
NewRegistry
NewRegistry accepts a list of proto message instances, ref.Type instances, or RegistryOption functions and returns a type provider.
common/types/provider.go:108
↓ 46 callers
Function
UnknownSizeEstimate
UnknownSizeEstimate returns a size between 0 and max uint.
common/cost/cost.go:183
↓ 45 callers
Method
Exec
Exec evaluates the expression within the given ExecutionFrame.
interpreter/interpretable.go:46
↓ 45 callers
Function
Overload
Overload defines a new global overload with an overload id, argument types, and result type. Through the use of OverloadOpt options, the overload may
common/decls/decls.go:610
↓ 45 callers
Method
Size
Size returns the number of elements or length of the value.
common/types/traits/sizer.go:24
↓ 44 callers
Method
Descriptor
Descriptor returns the protoreflect.FieldDescriptor for this type.
common/types/pb/type.go:243
↓ 44 callers
Method
ReportErrorAtID
ReportErrorAtID logs an error during parsing which is included in the issue set returned from a failed parse.
policy/parser.go:465
↓ 43 callers
Method
ActualCost
ActualCost returns the tracked cost through the course of execution when `CostTracking` is enabled. Otherwise, returns nil if the cost was not enabled
cel/program.go:206
↓ 43 callers
Function
NewDynamicList
NewDynamicList returns a traits.Lister with heterogenous elements. value should be an array of "native" types, i.e. any type that NativeToValue() can
common/types/list.go:39
↓ 42 callers
Method
AsComprehension
AsComprehension adapts the expr into a ComprehensionExpr. The Kind() must be equal to a ComprehensionKind for the conversion to be well-defined.
common/ast/expr.go:72
↓ 42 callers
Function
EmptyActivation
EmptyActivation returns a variable-free activation.
interpreter/activation.go:39
↓ 41 callers
Method
AsSelect
AsSelect adapts the expr into a SelectExpr. The Kind() must be equal to a SelectKind for the conversion to be well-defined.
common/ast/expr.go:97
↓ 41 callers
Method
Name
Name returns the name of the validator. Names must be unique.
cel/validator.go:128
↓ 41 callers
Function
NewParser
NewParser builds and returns a new Parser using the provided options.
parser/parser.go:32
↓ 40 callers
Method
Close
Close releases the resources held by the execution frame and returns it to the pool.
interpreter/frame.go:177
↓ 40 callers
Method
NativeRep
NativeRep converts the AST to a Go-native representation.
cel/env.go:60
↓ 40 callers
Function
NewMapType
NewMapType creates an instance of a map type value with the provided key and value types.
common/types/types.go:520
↓ 40 callers
Method
Next
Next returns the next element.
common/types/traits/iterator.go:35
↓ 40 callers
Method
ProtoReflect
()
fuzzing/cel_go_lpm.pb.go:59
↓ 40 callers
Function
Strings
Strings returns a cel.EnvOption to configure extended functions for string manipulation. As a general note, all indices are zero-based. # CharAt Int
ext/strings.go:316
↓ 39 callers
Method
Elements
Elements returns the list elements as navigable expressions.
common/ast/expr.go:182
↓ 39 callers
Function
NewAST
NewAST creates a base AST instance with an ast.Expr and ast.SourceInfo value.
common/ast/ast.go:108
↓ 39 callers
Function
NewTypeParamType
NewTypeParamType creates a parameterized type instance.
common/types/types.go:610
next →
1–100 of 9,178, ranked by callers