Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SdkToProto and ProtoToSDK public #758

Merged
merged 2 commits into from
Feb 15, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions binding/format/protobuf/v2/protobuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (protobufFmt) Unmarshal(b []byte, e *event.Event) error {
}

// convert an SDK event to a protobuf variant of the event that can be marshaled.
func sdkToProto(e *event.Event) (*pb.CloudEvent, error) {
n3wscott marked this conversation as resolved.
Show resolved Hide resolved
func SdkToProto(e *event.Event) (*pb.CloudEvent, error) {
container := &pb.CloudEvent{
Id: e.ID(),
Source: e.Source(),
Expand Down Expand Up @@ -191,7 +191,7 @@ func valueFrom(attr *pb.CloudEventAttributeValue) (interface{}, error) {
}

// Convert from a protobuf variant into the generic, SDK event.
func protoToSDK(container *pb.CloudEvent) (*event.Event, error) {
func ProtoToSDK(container *pb.CloudEvent) (*event.Event, error) {
e := event.New()
e.SetID(container.Id)
e.SetSource(container.Source)
Expand Down