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

Function ConstantToVal

common/ast/conversion.go:664–666  ·  view source on GitHub ↗

ConstantToVal converts a protobuf Constant to a CEL-native ref.Val.

(c *exprpb.Constant)

Source from the content-addressed store, hash-verified

662
663// ConstantToVal converts a protobuf Constant to a CEL-native ref.Val.
664func ConstantToVal(c *exprpb.Constant) (ref.Val, error) {
665 return AlphaProtoConstantAsVal(c)
666}
667
668// AlphaProtoConstantAsVal converts a v1alpha1.Constant protobuf to a CEL-native ref.Val.
669func AlphaProtoConstantAsVal(c *exprpb.Constant) (ref.Val, error) {

Callers 4

TestConvertValFunction · 0.92
TestConstantToValErrorFunction · 0.92
exprLiteralFunction · 0.85
ProtoToReferenceInfoFunction · 0.85

Calls 1

AlphaProtoConstantAsValFunction · 0.85

Tested by 2

TestConvertValFunction · 0.74
TestConstantToValErrorFunction · 0.74