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

Function Abbrevs

cel/options.go:305–314  ·  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

303// abbreviation, the abbreviation wins as this will ensure that the meaning of a program is
304// preserved between compilations even as the container evolves.
305func Abbrevs(qualifiedNames ...string) EnvOption {
306 return func(e *Env) (*Env, error) {
307 cont, err := e.Container.Extend(containers.Abbrevs(qualifiedNames...))
308 if err != nil {
309 return nil, err
310 }
311 e.Container = cont
312 return e, nil
313 }
314}
315
316// protoTypeRegistry is an internal-only interface containing the minimum methods required to support
317// custom types. It is a subset of methods from ref.TypeRegistry.

Callers 9

CompileRuleFunction · 0.92
TestStringFormatFunction · 0.92
TestStringFormatV2Function · 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 7

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