ReferenceInfoToProto converts a ReferenceInfo instance to a protobuf Reference suitable for serialization.
(info *ReferenceInfo)
| 610 | |
| 611 | // ReferenceInfoToProto converts a ReferenceInfo instance to a protobuf Reference suitable for serialization. |
| 612 | func ReferenceInfoToProto(info *ReferenceInfo) (*exprpb.Reference, error) { |
| 613 | c, err := ValToConstant(info.Value) |
| 614 | if err != nil { |
| 615 | return nil, err |
| 616 | } |
| 617 | return &exprpb.Reference{ |
| 618 | Name: info.Name, |
| 619 | OverloadId: info.OverloadIDs, |
| 620 | Value: c, |
| 621 | }, nil |
| 622 | } |
| 623 | |
| 624 | // ProtoToReferenceInfo converts a protobuf Reference into a CEL-native ReferenceInfo instance. |
| 625 | func ProtoToReferenceInfo(ref *exprpb.Reference) (*ReferenceInfo, error) { |