70 lines
1021 B
Protocol Buffer
70 lines
1021 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
import "docker.proto";
|
|
|
|
// 整体封装的消息体
|
|
message RequestFrame {
|
|
uint32 packet_id = 1;
|
|
oneof body {
|
|
AuthRequest auth_request = 2;
|
|
ContainerRequest container_request = 3;
|
|
}
|
|
}
|
|
|
|
message ReplyFrame {
|
|
uint32 packet_id = 1;
|
|
oneof reply {
|
|
ReplyResult result = 2;
|
|
ReplyError error = 3;
|
|
}
|
|
}
|
|
|
|
message ReplyResult {
|
|
bytes data = 1;
|
|
}
|
|
|
|
message ReplyError {
|
|
int32 code = 1;
|
|
string message = 2;
|
|
}
|
|
|
|
message CastFrame {
|
|
oneof body {
|
|
Pub pub = 1;
|
|
Command command = 2;
|
|
Data data = 3;
|
|
TaskEventStream event_stream = 4;
|
|
}
|
|
}
|
|
|
|
// message定义
|
|
message AuthRequest {
|
|
bytes uuid = 1;
|
|
bytes username = 2;
|
|
bytes salt = 3;
|
|
bytes token = 4;
|
|
int32 timestamp = 5;
|
|
}
|
|
|
|
message Pub {
|
|
bytes topic = 1;
|
|
int32 qos = 2;
|
|
bytes content = 3;
|
|
}
|
|
|
|
message Command {
|
|
int32 command_type = 1;
|
|
bytes command = 2;
|
|
}
|
|
|
|
message Data {
|
|
bytes route_key = 1;
|
|
bytes metric = 2;
|
|
}
|
|
|
|
message TaskEventStream {
|
|
int32 task_id = 1;
|
|
bytes type = 2;
|
|
bytes stream = 3;
|
|
}
|