mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 03:05:14 +00:00
36 lines
855 B
Protocol Buffer
36 lines
855 B
Protocol Buffer
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;
|
|
}
|