Skip to content

Commit

Permalink
update publish interface.
Browse files Browse the repository at this point in the history
Signed-off-by: morvencao <[email protected]>
  • Loading branch information
morvencao committed Nov 10, 2023
1 parent e7d6864 commit ca8841e
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 82 deletions.
2 changes: 1 addition & 1 deletion binding/format/protobuf/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ go 1.18

require (
github.com/cloudevents/sdk-go/v2 v2.5.0
github.com/golang/protobuf v1.5.3
github.com/stretchr/testify v1.8.0
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/json-iterator/go v1.1.10 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
Expand Down
186 changes: 131 additions & 55 deletions binding/format/protobuf/v2/pb/cloudevent.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions binding/format/protobuf/v2/pb/cloudevent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,23 @@ message CloudEventAttributeValue {
}
}

message Subscription {
// Required. The subscription from which messages should be pulled.
message PublishRequest {
// Required. The topic to which event should be published.
// Format is `myhome/groundfloor/livingroom/temperature`.
string subscription = 1;
string topic = 1;
CloudEvent event = 2;
}

message SubscriptionRequest {
// Required. The topic from which event should be pulled.
// Format is `myhome/groundfloor/livingroom/temperature`.
string topic = 1;
}

service CloudEventService {
rpc Publish(CloudEvent) returns (google.protobuf.Empty) {
rpc Publish(PublishRequest) returns (google.protobuf.Empty) {
}

rpc Subscribe(Subscription) returns (stream CloudEvent) {
rpc Subscribe(SubscriptionRequest) returns (stream CloudEvent) {
}
}
Loading

0 comments on commit ca8841e

Please sign in to comment.