-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathservice.proto
44 lines (34 loc) · 1.05 KB
/
service.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
syntax = "proto3";
option go_package = ".;main";
// для генерации сервиса:
// protoc --go_out=plugins=grpc:. *.proto
// у вас должен быть установлен protoc
// полученный код при загрузки в автогрейдер надо будет положить в service.go
// на время тестов можно ничего не делать
package main;
message Event {
int64 timestamp = 1;
string consumer = 2;
string method = 3;
string host = 4;
}
message Stat {
int64 timestamp = 1;
map<string, uint64> by_method = 2;
map<string, uint64> by_consumer = 3;
}
message StatInterval {
uint64 interval_seconds = 1;
}
message Nothing {
bool dummy = 1;
}
service Admin {
rpc Logging (Nothing) returns (stream Event) {}
rpc Statistics (StatInterval) returns (stream Stat) {}
}
service Biz {
rpc Check(Nothing) returns(Nothing) {}
rpc Add(Nothing) returns(Nothing) {}
rpc Test(Nothing) returns(Nothing) {}
}