You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
743 B
47 lines
743 B
// 版本
|
|
syntax = "proto3";
|
|
|
|
// 包名
|
|
package pb;
|
|
|
|
// 别名
|
|
option go_package = "../pb";
|
|
|
|
// 定义服务
|
|
service PubSub {
|
|
// [发布] 消息
|
|
rpc Publish (PublishRequest) returns (PublishResponse);
|
|
// [订阅] 消息
|
|
rpc Subscribe (SubscribeRequest) returns (stream SubscribeResponse);
|
|
}
|
|
|
|
// 请求消息
|
|
message PublishRequest {
|
|
string id = 1;
|
|
string value = 2;
|
|
string method = 3;
|
|
string ip = 4;
|
|
}
|
|
|
|
// 响应消息
|
|
message PublishResponse {
|
|
string id = 1;
|
|
string value = 2;
|
|
string ip = 3;
|
|
}
|
|
|
|
// 请求消息
|
|
message SubscribeRequest {
|
|
string id = 1;
|
|
string value = 2;
|
|
string method = 3;
|
|
string ip = 4;
|
|
}
|
|
|
|
// 响应消息
|
|
message SubscribeResponse {
|
|
string id = 1;
|
|
string value = 2;
|
|
string method = 3;
|
|
}
|