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

Function ASTValidators

cel/validator.go:93–110  ·  view source on GitHub ↗

ASTValidators configures a set of ASTValidator instances into the target environment. Validators are applied in the order in which they are specified. If an ASTValidator with the same name is already configured, it will be replaced.

(validators ...ASTValidator)

Source from the content-addressed store, hash-verified

91// Validators are applied in the order in which they are specified.
92// If an ASTValidator with the same name is already configured, it will be replaced.
93func ASTValidators(validators ...ASTValidator) EnvOption {
94 return func(e *Env) (*Env, error) {
95 for _, v := range validators {
96 found := false
97 for i, existing := range e.validators {
98 if existing.Name() == v.Name() {
99 e.validators[i] = v
100 found = true
101 break
102 }
103 }
104 if !found {
105 e.validators = append(e.validators, v)
106 }
107 }
108 return e, nil
109 }
110}
111
112// ASTValidator defines a singleton interface for validating a type-checked Ast against an environment.
113//

Callers 15

TestStringFormatFunction · 0.92
TestStringFormatV2Function · 0.92
CompileOptionsMethod · 0.92
CompileOptionsMethod · 0.92
CompileOptionsMethod · 0.92
configToEnvOptionsFunction · 0.85
RegexProgramSizeLimitFunction · 0.85
ExtendedValidationsFunction · 0.85

Calls 1

NameMethod · 0.65