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

Function Protos

ext/protos.go:54–60  ·  view source on GitHub ↗

Protos returns a cel.EnvOption to configure extended macros and functions for proto manipulation. Note, all macros use the 'proto' namespace; however, at the time of macro expansion the namespace looks just like any other identifier. If you are currently using a variable named 'proto', the macro wi

(options ...ProtosOption)

Source from the content-addressed store, hash-verified

52//
53// proto.hasExt(msg, google.expr.proto2.test.int32_ext) // returns true || false
54func Protos(options ...ProtosOption) cel.EnvOption {
55 l := &protoLib{version: math.MaxUint32}
56 for _, o := range options {
57 l = o(l)
58 }
59 return cel.Lib(l)
60}
61
62// ProtosOption declares a functional operator for configuring protobuf utilities.
63type ProtosOption func(*protoLib) *protoLib

Callers 6

initFunction · 0.92
evaluator.goFile · 0.92
testProtosEnvFunction · 0.85
TestProtosWithExtensionFunction · 0.85
TestProtosVersionFunction · 0.85

Calls 1

LibFunction · 0.92

Tested by 4

initFunction · 0.74
testProtosEnvFunction · 0.68
TestProtosWithExtensionFunction · 0.68
TestProtosVersionFunction · 0.68