-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathgrpc_broker.proto
113 lines (89 loc) · 1.95 KB
/
grpc_broker.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
syntax = "proto3";
package goalgo;
// The robot control service definition.
service RobotCtl {
// 获取运行参数
rpc GetRobotOptions (RobotOptionsRequest) returns (RobotOptionsReply) {}
// 获取交易所配置
rpc GetRobotExchangeInfo (RobotExchangeInfoRequest) returns (RobotExchangeInfoReply) {}
// 获取配置值
rpc GetValue (GetValueRequest) returns (GetValueReply) {}
// 保存配置值
rpc SetValue (SetValueRequest) returns (SetValueReply) {}
// 写入日志
rpc Log (LogRequest) returns (LogReply) {}
// 更新状态
rpc UpdateStatus (UpdateStatusRequest) returns (UpdateStatusReply) {}
// 更新统计数据
rpc UpdateStat (StatRequest) returns (StatReply) {}
}
message RobotOptionsRequest {
string uid = 1;
string robot_id = 2;
}
message RobotOption {
string key = 1;
string value = 2;
}
message RobotOptionsReply {
repeated RobotOption options = 1;
}
message RobotExchangeInfoRequest {
string uid = 1;
string robot_id = 2;
}
message RobotExchangeInfo {
string label = 1;
string name = 2;
string access_key = 3;
string secret_key = 4;
}
message RobotExchangeInfoReply {
repeated RobotExchangeInfo exchanges = 1;
}
message GetValueRequest {
string robot_id = 1;
string key = 2;
}
message GetValueReply {
bool success = 1;
string message = 2;
bytes value = 3;
}
message SetValueRequest {
string robot_id = 1;
string key = 2;
bytes value = 3;
}
message SetValueReply {
bool success = 1;
string message = 2;
}
message LogRequest {
int32 sid = 1;
uint64 id = 2;
int64 time = 3;
int32 level = 4;
string message = 5;
}
message LogReply {
bool success = 1;
string message = 2;
}
message UpdateStatusRequest {
string robot_id = 1;
int32 status = 2;
}
message UpdateStatusReply {
bool success = 1;
string message = 2;
}
message StatRequest {
string robot_id = 1;
string name = 2;
bytes value = 3;
}
message StatReply {
bool success = 1;
string message = 2;
}