-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.proto
94 lines (80 loc) · 1.63 KB
/
common.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
syntax = "proto3";
package telegraph;
message Empty {}
message Group {
int32 id = 1; // optional
string name = 2;
string pretty = 3;
string desc = 4;
string schema = 5;
int32 version = 6;
repeated Node children = 7;
}
message Variable {
int32 id = 1; // optional
string name = 3;
string pretty = 4;
string desc = 5;
Type data_type = 6;
}
message Action {
int32 id = 1; // optional
string name = 3;
string pretty = 4;
string desc = 5;
Type arg_type = 6;
Type ret_type = 7;
}
message Node {
oneof node {
Group group = 1;
Variable var = 2;
Action action = 3;
// this should only be used for the stream protocol, nowhere else
int32 placeholder = 4;
}
}
// ------------ Type/Value Utilities -----------------
message Type {
enum Class {
INVALID = 0;
NONE = 1;
ENUM = 2;
BOOL = 3;
UINT8 = 4;
UINT16 = 5;
UINT32 = 6;
UINT64 = 7;
INT8 = 8;
INT16 = 9;
INT32 = 10;
INT64 = 11;
FLOAT = 12;
DOUBLE = 13;
}
Class type = 1;
string name = 2;
repeated string labels = 3;
}
message Value {
oneof type {
Empty invalid = 1;
Empty none = 2;
int32 en = 3;
bool b = 4;
uint32 u8 = 5;
uint32 u16 = 6;
uint32 u32 = 7;
uint64 u64 = 8;
int32 i8 = 9;
int32 i16 = 10;
int32 i32 = 11;
int64 i64 = 12;
float f = 13;
double d = 14;
}
}
message Datapoint {
uint64 timestamp = 1;
Value value = 2;
}