fix
This commit is contained in:
parent
2bda5f6d72
commit
bef8f3e815
54
proto/service.proto
Normal file
54
proto/service.proto
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
// 微服务通过 ws_channel 与 efka 之间的通道消息定义。
|
||||||
|
// 该协议用于替代当前基于 JSON 的请求/响应/推送格式。
|
||||||
|
|
||||||
|
message ServiceRequest {
|
||||||
|
uint32 packet_id = 1;
|
||||||
|
|
||||||
|
message Register {
|
||||||
|
string service_id = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Subscribe {
|
||||||
|
string topic = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
oneof request {
|
||||||
|
Register register = 10;
|
||||||
|
Subscribe subscribe = 11;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message ServiceReply {
|
||||||
|
uint32 packet_id = 1;
|
||||||
|
|
||||||
|
message Error {
|
||||||
|
int32 code = 1;
|
||||||
|
string message = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
oneof reply {
|
||||||
|
bytes result = 10;
|
||||||
|
Error error = 11;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message ServiceCast {
|
||||||
|
|
||||||
|
message MetricData {
|
||||||
|
bytes route_key = 1;
|
||||||
|
bytes metric = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message TopicEvent {
|
||||||
|
string topic = 1;
|
||||||
|
bytes content = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
oneof body {
|
||||||
|
TopicEvent topic_event = 10;
|
||||||
|
MetricData metric_data = 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user