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

Function Abbrevs

cel/options.go:320–329  ·  view source on GitHub ↗

Abbrevs configures a set of simple names as abbreviations for fully-qualified names. An abbreviation (abbrev for short) is a simple name that expands to a fully-qualified name. Abbreviations can be useful when working with variables, functions, and especially types from multiple namespaces: // CE

(qualifiedNames ...string)

Source from the content-addressed store, hash-verified

318// abbreviation, the abbreviation wins as this will ensure that the meaning of a program is
319// preserved between compilations even as the container evolves.
320func Abbrevs(qualifiedNames ...string) EnvOption {
321 return func(e *Env) (*Env, error) {
322 cont, err := e.Container.Extend(containers.Abbrevs(qualifiedNames...))
323 if err != nil {
324 return nil, err
325 }
326 e.Container = cont
327 return e, nil
328 }
329}
330
331// protoTypeRegistry is an internal-only interface containing the minimum methods required to support
332// custom types. It is a subset of methods from ref.TypeRegistry.

Callers 10

CompileRuleFunction · 0.92
TestStringFormatFunction · 0.92
TestStringFormatV2Function · 0.92
testNativeEnvFunction · 0.92
testNativeEnvFunction · 0.92
configToEnvOptionsFunction · 0.70
TestEnvToConfigFunction · 0.70
TestAbbrevsCompiledFunction · 0.70
TestAbbrevsParsedFunction · 0.70

Calls 2

AbbrevsFunction · 0.92
ExtendMethod · 0.45

Tested by 8

TestStringFormatFunction · 0.74
TestStringFormatV2Function · 0.74
testNativeEnvFunction · 0.74
testNativeEnvFunction · 0.74
TestEnvToConfigFunction · 0.56
TestAbbrevsCompiledFunction · 0.56
TestAbbrevsParsedFunction · 0.56