-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.proto
45 lines (35 loc) · 852 Bytes
/
schema.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
syntax = "proto3";
package schema;
import "google/protobuf/timestamp.proto";
option go_package = "./";
enum DataType {
NONE = 0;
CARBON_MONOXIDE = 1;
AIR_QUALITY = 2;
RAINDROPS = 3;
SOIL_MOISTURE = 4;
}
message Data {
DataType data_type = 1;
float value = 2;
google.protobuf.Timestamp timestamp = 3;
}
message DataWithCategory {
Data data = 1;
int32 category = 2;
}
message Reply {}
message DataRequest {
DataType data_type = 1;
}
message DataRepeated {
repeated DataWithCategory data = 1;
}
service Request {
rpc Add (Data) returns (Reply) {}
rpc Latest(DataRequest) returns (DataWithCategory) {}
rpc Last24H(DataRequest) returns (DataRepeated) {}
rpc Median(DataRequest) returns (DataWithCategory) {}
rpc Max(DataRequest) returns (DataWithCategory) {}
rpc Min(DataRequest) returns (DataWithCategory) {}
}