-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.proto
107 lines (84 loc) · 2.01 KB
/
test.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
95
96
97
98
99
100
101
102
103
104
105
106
107
syntax = "proto3";
// This is a test comment on testobj
service _method_Testobj {
/* This is a test comment on func1 */
rpc func1 (Testobj_func1_arg) returns (Testobj_func2_arg) {}
// This is a multiline test
// Comment on func2
rpc func2 (Testobj_func2_arg) returns (Testobj_func3_arg) {}
/* This is a different test
comment on func3 */
rpc func3 (Testobj_func3_arg) returns (Testobj_func1_arg) {}
rpc funcnone (empty) returns (empty) {}
rpc funchard (Testobj) returns (Testobj) {}
rpc funceverything (dense) returns (dense) {}
rpc funcinlineprim (inlineprim) returns (inlineprim) {}
rpc funcinlinelist (inlinelist) returns (inlinelist) {}
rpc funcinlinemap (inlinemap) returns (inlinemap) {}
}
service _method_Childobj {
}
message Testobj {
oneof impls {
_impl_Testobj opt1 = 1;
Childobj opt2 = 2;
}
}
message Childobj {
oneof impls {
_impl_Childobj opt1 = 1;
}
}
message _impl_Testobj {
int32 fielda = 1;
}
message _impl_Childobj {
int32 fielda = 1;
int32 fieldb = 2;
}
/* This is a test comment shouldn't be included */
message Testobj_func1_arg {
string Name = 1;
int32 id = 2;
double floatingvalue = 3;
}
message Testobj_func2_arg {
repeated string Liststring = 2;
map<int32, Testobj_func1_arg> Idtostringmap = 3;
}
message Testobj_func3_arg {
Testobj_func2_arg Nested = 1;
}
message empty {
}
message dense {
double d = 1;
float f = 2;
int32 i = 3;
int64 l = 4;
bool b = 5;
string s = 6;
bytes bys = 7;
repeated double ds = 8;
repeated float fs = 9;
repeated int32 is = 10;
repeated int64 ls = 11;
repeated bool bs = 12;
repeated string ss = 13;
map<int32, int64> itol = 17;
map<int64, bool> ltob = 18;
map<bool, string> btos = 19;
map<string, int32> stoi = 20;
map<int32, float> itof = 21;
map<int32, double> itod = 22;
//map key cannot be float/double, bytes or message in protobuf
}
message inlineprim {
int32 ival = 1;
}
message inlinelist {
repeated int32 ivallst = 1;
}
message inlinemap {
map<int32, int32> ivalmap = 1;
}