-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypes.proto
99 lines (83 loc) · 2.15 KB
/
types.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
syntax = "proto3";
package cases;
option go_package = "cases/;cases";
import "cases/from_other_file.proto";
import "google/protobuf/any.proto";
import "google/type/date.proto";
enum MyEnum {
UNDEFINED = 0;
ONE = 1;
TWO = 2;
THREE = 3;
}
message TestNestedExternalMessage {
string foo = 1;
int32 bar = 2;
}
message Foo {
double my_double_field = 1;
float my_float_field = 2;
int32 my_int_32_field = 3;
int64 my_int_64_field = 4;
uint32 my_uint_32_field = 5;
uint64 my_uint_64_field = 6;
sint32 my_sint_32_field = 7;
sint64 my_sint_64_field = 8;
fixed32 my_fixed_32_field = 9;
fixed64 my_fixed_64_field = 10;
sfixed32 my_sfixed_32_field = 11;
sfixed64 my_sfixed_64_field = 12;
bool my_bool_field = 13;
string my_string_field = 14;
bytes my_bytes_field = 15;
MyEnum my_enum_field = 16;
google.protobuf.Any my_any_field = 17;
oneof my_oneof_field {
string option_1 = 18;
google.protobuf.Any option_2 = 19;
}
map<string, string> my_map_field = 20;
repeated string my_string_list_field = 21;
repeated google.protobuf.Any my_any_list_field = 22;
google.type.Date my_date_field = 23;
TestNestedExternalMessage my_nested_ext_msg = 24;
message TestNestedInternalMessage {
string foo = 1;
int32 bar = 2;
}
TestNestedInternalMessage my_nested_int_msg = 25;
YetAnotherTestNestedExternalMessage my_yet_another_test_nested_external_msg = 26;
}
message TestReservedGoFieldNames {
// These fields are reserved Go field names and should be escaped.
// copied from https://golang.org/ref/spec#Keywords
string break = 2;
string case = 3;
string chan = 4;
string const = 5;
string continue = 6;
string default = 7;
string defer = 8;
string else = 9;
string fallthrough = 10;
string for = 11;
string func = 12;
string go = 13;
string goto = 14;
string if = 15;
string import = 16;
string interface = 17;
string map = 18;
string package = 19;
string range = 20;
string return = 21;
string select = 22;
string struct = 23;
string switch = 24;
string type = 25;
string var = 26;
}
message EmptyMessage {}
message TestMessageWithEmptyMessage {
EmptyMessage empty = 1;
}