MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Program

Interface Program

cel/program.go:30–55  ·  view source on GitHub ↗

Program is an evaluable view of an Ast.

Source from the content-addressed store, hash-verified

28
29// Program is an evaluable view of an Ast.
30type Program interface {
31 // Eval returns the result of an evaluation of the Ast and environment against the input vars.
32 //
33 // The vars value may either be an `Activation` or a `map[string]any`.
34 //
35 // If the `OptTrackState`, `OptTrackCost` or `OptExhaustiveEval` flags are used, the `details` response will
36 // be non-nil. Given this caveat on `details`, the return state from evaluation will be:
37 //
38 // * `val`, `details`, `nil` - Successful evaluation of a non-error result.
39 // * `val`, `details`, `err` - Successful evaluation to an error result.
40 // * `nil`, `details`, `err` - Unsuccessful evaluation.
41 //
42 // An unsuccessful evaluation is typically the result of a series of incompatible `EnvOption`
43 // or `ProgramOption` values used in the creation of the evaluation environment or executable
44 // program.
45 Eval(any) (ref.Val, *EvalDetails, error)
46
47 // ContextEval evaluates the program with a set of input variables and a context object in order
48 // to support cancellation and timeouts. This method must be used in conjunction with the
49 // InterruptCheckFrequency() option for cancellation interrupts to be impact evaluation.
50 //
51 // The vars value may either be an `Activation` or `map[string]any`.
52 //
53 // The output contract for `ContextEval` is otherwise identical to the `Eval` method.
54 ContextEval(context.Context, any) (ref.Val, *EvalDetails, error)
55}
56
57// Activation used to resolve identifiers by name and references by id.
58//

Callers 14

evalMethod · 0.65
ExecuteTestMethod · 0.65
TestSimpleVariablesFunction · 0.65
TestWhitespaceHanldingFunction · 0.65
runMethod · 0.65
benchMethod · 0.65
evalMethod · 0.65
RunCaseFunction · 0.65
TestEvalFunction · 0.65
TestContextEvalFunction · 0.65
TestContextEvalUnknownsFunction · 0.65
BenchmarkContextEvalFunction · 0.65

Implementers 1

progcel/program.go

Calls

no outgoing calls

Tested by

no test coverage detected