@@ -56,7 +56,7 @@ func (protobufFmt) MediaType() string {
56
56
}
57
57
58
58
func (protobufFmt ) Marshal (e * event.Event ) ([]byte , error ) {
59
- pbe , err := sdkToProto (e )
59
+ pbe , err := ToProto (e )
60
60
if err != nil {
61
61
return nil , err
62
62
}
@@ -67,7 +67,7 @@ func (protobufFmt) Unmarshal(b []byte, e *event.Event) error {
67
67
if err := proto .Unmarshal (b , pbe ); err != nil {
68
68
return err
69
69
}
70
- e2 , err := protoToSDK (pbe )
70
+ e2 , err := FromProto (pbe )
71
71
if err != nil {
72
72
return err
73
73
}
@@ -76,7 +76,7 @@ func (protobufFmt) Unmarshal(b []byte, e *event.Event) error {
76
76
}
77
77
78
78
// convert an SDK event to a protobuf variant of the event that can be marshaled.
79
- func sdkToProto (e * event.Event ) (* pb.CloudEvent , error ) {
79
+ func ToProto (e * event.Event ) (* pb.CloudEvent , error ) {
80
80
container := & pb.CloudEvent {
81
81
Id : e .ID (),
82
82
Source : e .Source (),
@@ -191,7 +191,7 @@ func valueFrom(attr *pb.CloudEventAttributeValue) (interface{}, error) {
191
191
}
192
192
193
193
// Convert from a protobuf variant into the generic, SDK event.
194
- func protoToSDK (container * pb.CloudEvent ) (* event.Event , error ) {
194
+ func FromProto (container * pb.CloudEvent ) (* event.Event , error ) {
195
195
e := event .New ()
196
196
e .SetID (container .Id )
197
197
e .SetSource (container .Source )
0 commit comments