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
syntax = "proto3";
package emerwen.webtomaster;
option go_package = "git.src.quest/~liljamo/emerwen-proto/go/proto";
import "google/protobuf/empty.proto";
import "shared/target.proto";
import "shared/worker.proto";
service WebToMaster {
rpc GetWorkers (google.protobuf.Empty) returns (WorkersResponse);
rpc NewWorker (NewWorkerRequest) returns (NewWorkerResponse);
rpc NewTarget (NewTargetRequest) returns (NewTargetResponse);
rpc PatchWorker (PatchWorkerRequest) returns (PatchWorkerResponse);
rpc PatchTarget (PatchTargetRequest) returns (PatchTargetResponse);
rpc DeleteWorker (DeleteWorkerRequest) returns (DeleteWorkerResponse);
rpc DeleteTarget (DeleteTargetRequest) returns (DeleteTargetResponse);
}
message WorkersResponse {
repeated shared.Worker workers = 1;
}
message NewWorkerRequest {
string name = 1;
}
message NewWorkerResponse {
bool success = 1;
optional string msg = 2;
}
message NewTargetRequest {
string worker_id = 1;
string name = 2;
string addr = 3;
int32 interval = 4;
oneof method {
shared.MethodPing ping = 5;
shared.MethodGET get = 6;
}
}
message NewTargetResponse {
bool success = 1;
optional string msg = 2;
}
message PatchWorkerRequest {
string worker_id = 1;
optional string name = 2;
}
message PatchWorkerResponse {
bool success = 1;
optional string msg = 2;
}
message PatchTargetRequest {
string target_id = 1;
optional string name = 2;
optional string addr = 3;
optional int32 interval = 4;
oneof method {
shared.MethodPing ping = 5;
shared.MethodGET get = 6;
}
}
message PatchTargetResponse {
bool success = 1;
optional string msg = 2;
}
message DeleteWorkerRequest {
string worker_id = 1;
}
message DeleteWorkerResponse {
bool success = 1;
optional string msg = 2;
}
message DeleteTargetRequest {
string target_id = 1;
}
message DeleteTargetResponse {
bool success = 1;
optional string msg = 2;
}