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
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);
}
message WorkersResponse {
repeated shared.Worker workers = 1;
}
message NewWorkerRequest {
string name = 1;
}
message NewWorkerResponse {
bool success = 1;
}
message NewTargetRequest {
string worker_id = 1;
string name = 2;
string addr = 3;
uint32 interval = 4;
oneof method {
shared.MethodPing ping = 5;
shared.MethodGET get = 6;
}
}
message NewTargetResponse {
bool success = 1;
}
message PatchWorkerRequest {
optional string name = 1;
}
message PatchWorkerResponse {
bool success = 1;
}
message PatchTargetRequest {
optional string name = 1;
optional string addr = 2;
optional uint32 interval = 3;
oneof method {
shared.MethodPing ping = 4;
shared.MethodGET get = 5;
}
}
message PatchTargetResponse {
bool success = 1;
}