Skip to content

Commit ca8841e

Browse files
committed
update publish interface.
Signed-off-by: morvencao <lcao@redhat.com>
1 parent e7d6864 commit ca8841e

File tree

7 files changed

+180
-82
lines changed

7 files changed

+180
-82
lines changed

binding/format/protobuf/v2/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ go 1.18
44

55
require (
66
github.com/cloudevents/sdk-go/v2 v2.5.0
7+
github.com/golang/protobuf v1.5.3
78
github.com/stretchr/testify v1.8.0
89
google.golang.org/grpc v1.59.0
910
google.golang.org/protobuf v1.31.0
1011
)
1112

1213
require (
1314
github.com/davecgh/go-spew v1.1.1 // indirect
14-
github.com/golang/protobuf v1.5.3 // indirect
1515
github.com/google/uuid v1.3.1 // indirect
1616
github.com/json-iterator/go v1.1.10 // indirect
1717
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect

binding/format/protobuf/v2/pb/cloudevent.pb.go

Lines changed: 131 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

binding/format/protobuf/v2/pb/cloudevent.proto

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,23 @@ message CloudEventAttributeValue {
6161
}
6262
}
6363

64-
message Subscription {
65-
// Required. The subscription from which messages should be pulled.
64+
message PublishRequest {
65+
// Required. The topic to which event should be published.
6666
// Format is `myhome/groundfloor/livingroom/temperature`.
67-
string subscription = 1;
67+
string topic = 1;
68+
CloudEvent event = 2;
69+
}
70+
71+
message SubscriptionRequest {
72+
// Required. The topic from which event should be pulled.
73+
// Format is `myhome/groundfloor/livingroom/temperature`.
74+
string topic = 1;
6875
}
6976

7077
service CloudEventService {
71-
rpc Publish(CloudEvent) returns (google.protobuf.Empty) {
78+
rpc Publish(PublishRequest) returns (google.protobuf.Empty) {
7279
}
7380

74-
rpc Subscribe(Subscription) returns (stream CloudEvent) {
81+
rpc Subscribe(SubscriptionRequest) returns (stream CloudEvent) {
7582
}
7683
}

0 commit comments

Comments
 (0)