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

Function AlphaProtoAsDeclaration

cel/decls.go:408–414  ·  view source on GitHub ↗

AlphaProtoAsDeclaration converts a v1alpha1.Decl value describing a variable or function into an EnvOption.

(d *exprpb.Decl)

Source from the content-addressed store, hash-verified

406
407// AlphaProtoAsDeclaration converts a v1alpha1.Decl value describing a variable or function into an EnvOption.
408func AlphaProtoAsDeclaration(d *exprpb.Decl) (EnvOption, error) {
409 canonical := &celpb.Decl{}
410 if err := convertProto(d, canonical); err != nil {
411 return nil, err
412 }
413 return ProtoAsDeclaration(canonical)
414}
415
416// ProtoAsDeclaration converts a canonical celpb.Decl value describing a variable or function into an EnvOption.
417func ProtoAsDeclaration(d *celpb.Decl) (EnvOption, error) {

Callers 1

ExprDeclToDeclarationFunction · 0.85

Calls 2

ProtoAsDeclarationFunction · 0.85
convertProtoFunction · 0.70

Tested by

no test coverage detected