mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-19 14:05:23 +00:00
add stream service (#188)
This commit is contained in:
35
stream/proto/stream.proto
Normal file
35
stream/proto/stream.proto
Normal file
@@ -0,0 +1,35 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package stream;
|
||||
|
||||
option go_package = "./proto;stream";
|
||||
import "google/protobuf/struct.proto";
|
||||
|
||||
service Stream {
|
||||
rpc Publish(PublishRequest) returns (PublishResponse) {}
|
||||
rpc Subscribe(SubscribeRequest) returns (stream SubscribeResponse) {}
|
||||
}
|
||||
|
||||
// Publish a message to the stream. Specify a topic to group messages for a specific topic.
|
||||
message PublishRequest {
|
||||
// The topic to publish to
|
||||
string topic = 1;
|
||||
// The json message to publish
|
||||
google.protobuf.Struct message = 2;
|
||||
}
|
||||
|
||||
message PublishResponse {}
|
||||
|
||||
// Subscribe to messages for a given topic.
|
||||
message SubscribeRequest {
|
||||
// The topic to subscribe to
|
||||
string topic = 1;
|
||||
}
|
||||
|
||||
// A blocking stream will be returned in response.
|
||||
message SubscribeResponse {
|
||||
// The topic subscribed to
|
||||
string topic = 1;
|
||||
// The next json message on the topic
|
||||
google.protobuf.Struct message = 2;
|
||||
}
|
||||
Reference in New Issue
Block a user