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

Function Container

cel/options.go:265–274  ·  view source on GitHub ↗

Container sets the container for resolving variable names. Defaults to an empty container. If all references within an expression are relative to a protocol buffer package, then specifying a container of `google.type` would make it possible to write expressions such as `Expr{expression: 'a < b'}` i

(name string)

Source from the content-addressed store, hash-verified

263// specifying a container of `google.type` would make it possible to write expressions such as
264// `Expr{expression: 'a < b'}` instead of having to write `google.type.Expr{...}`.
265func Container(name string) EnvOption {
266 return func(e *Env) (*Env, error) {
267 cont, err := e.Container.Extend(containers.Name(name))
268 if err != nil {
269 return nil, err
270 }
271 e.Container = cont
272 return e, nil
273 }
274}
275
276// Abbrevs configures a set of simple names as abbreviations for fully-qualified names.
277//

Callers 15

TestStringFormatFunction · 0.92
testListsEnvFunction · 0.92
TestStringFormatV2Function · 0.92
TestTypeResolutionRaceFunction · 0.92
testNativeEnvFunction · 0.92
bindings_test.goFile · 0.92
testProtosEnvFunction · 0.92
exercise6Function · 0.92
conformanceTestFunction · 0.92

Calls 2

NameFunction · 0.92
ExtendMethod · 0.45

Tested by 15

TestStringFormatFunction · 0.74
testListsEnvFunction · 0.74
TestStringFormatV2Function · 0.74
TestTypeResolutionRaceFunction · 0.74
testNativeEnvFunction · 0.74
testProtosEnvFunction · 0.74
conformanceTestFunction · 0.74
OptionMethod · 0.74
TestEnvToConfigFunction · 0.56