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

Function ProtoToReferenceInfo

common/ast/conversion.go:625–635  ·  view source on GitHub ↗

ProtoToReferenceInfo converts a protobuf Reference into a CEL-native ReferenceInfo instance.

(ref *exprpb.Reference)

Source from the content-addressed store, hash-verified

623
624// ProtoToReferenceInfo converts a protobuf Reference into a CEL-native ReferenceInfo instance.
625func ProtoToReferenceInfo(ref *exprpb.Reference) (*ReferenceInfo, error) {
626 v, err := ConstantToVal(ref.GetValue())
627 if err != nil {
628 return nil, err
629 }
630 return &ReferenceInfo{
631 Name: ref.GetName(),
632 OverloadIDs: ref.GetOverloadId(),
633 Value: v,
634 }, nil
635}
636
637// ValToConstant converts a CEL-native ref.Val to a protobuf Constant.
638//

Callers 2

ToASTFunction · 0.85

Calls 3

ConstantToValFunction · 0.85
GetValueMethod · 0.80
GetNameMethod · 0.45

Tested by 1