descriptor.proto
6.45 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
syntax = "proto2";
package google.protobuf;
message FileDescriptorSet {
repeated FileDescriptorProto file = 1;
}
message FileDescriptorProto {
optional string name = 1;
optional string package = 2;
repeated string dependency = 3;
repeated int32 public_dependency = 10;
repeated int32 weak_dependency = 11;
repeated DescriptorProto message_type = 4;
repeated EnumDescriptorProto enum_type = 5;
repeated ServiceDescriptorProto service = 6;
repeated FieldDescriptorProto extension = 7;
optional FileOptions options = 8;
optional SourceCodeInfo source_code_info = 9;
optional string syntax = 12;
}
message DescriptorProto {
optional string name = 1;
repeated FieldDescriptorProto field = 2;
repeated FieldDescriptorProto extension = 6;
repeated DescriptorProto nested_type = 3;
repeated EnumDescriptorProto enum_type = 4;
repeated ExtensionRange extension_range = 5;
repeated OneofDescriptorProto oneof_decl = 8;
optional MessageOptions options = 7;
repeated ReservedRange reserved_range = 9;
repeated string reserved_name = 10;
message ExtensionRange {
optional int32 start = 1;
optional int32 end = 2;
}
message ReservedRange {
optional int32 start = 1;
optional int32 end = 2;
}
}
message FieldDescriptorProto {
optional string name = 1;
optional int32 number = 3;
optional Label label = 4;
optional Type type = 5;
optional string type_name = 6;
optional string extendee = 2;
optional string default_value = 7;
optional int32 oneof_index = 9;
optional string json_name = 10;
optional FieldOptions options = 8;
enum Type {
TYPE_DOUBLE = 1;
TYPE_FLOAT = 2;
TYPE_INT64 = 3;
TYPE_UINT64 = 4;
TYPE_INT32 = 5;
TYPE_FIXED64 = 6;
TYPE_FIXED32 = 7;
TYPE_BOOL = 8;
TYPE_STRING = 9;
TYPE_GROUP = 10;
TYPE_MESSAGE = 11;
TYPE_BYTES = 12;
TYPE_UINT32 = 13;
TYPE_ENUM = 14;
TYPE_SFIXED32 = 15;
TYPE_SFIXED64 = 16;
TYPE_SINT32 = 17;
TYPE_SINT64 = 18;
}
enum Label {
LABEL_OPTIONAL = 1;
LABEL_REQUIRED = 2;
LABEL_REPEATED = 3;
}
}
message OneofDescriptorProto {
optional string name = 1;
optional OneofOptions options = 2;
}
message EnumDescriptorProto {
optional string name = 1;
repeated EnumValueDescriptorProto value = 2;
optional EnumOptions options = 3;
}
message EnumValueDescriptorProto {
optional string name = 1;
optional int32 number = 2;
optional EnumValueOptions options = 3;
}
message ServiceDescriptorProto {
optional string name = 1;
repeated MethodDescriptorProto method = 2;
optional ServiceOptions options = 3;
}
message MethodDescriptorProto {
optional string name = 1;
optional string input_type = 2;
optional string output_type = 3;
optional MethodOptions options = 4;
optional bool client_streaming = 5;
optional bool server_streaming = 6;
}
message FileOptions {
optional string java_package = 1;
optional string java_outer_classname = 8;
optional bool java_multiple_files = 10;
optional bool java_generate_equals_and_hash = 20 [deprecated=true];
optional bool java_string_check_utf8 = 27;
optional OptimizeMode optimize_for = 9 [default=SPEED];
optional string go_package = 11;
optional bool cc_generic_services = 16;
optional bool java_generic_services = 17;
optional bool py_generic_services = 18;
optional bool deprecated = 23;
optional bool cc_enable_arenas = 31;
optional string objc_class_prefix = 36;
optional string csharp_namespace = 37;
repeated UninterpretedOption uninterpreted_option = 999;
enum OptimizeMode {
SPEED = 1;
CODE_SIZE = 2;
LITE_RUNTIME = 3;
}
extensions 1000 to max;
reserved 38;
}
message MessageOptions {
optional bool message_set_wire_format = 1;
optional bool no_standard_descriptor_accessor = 2;
optional bool deprecated = 3;
optional bool map_entry = 7;
repeated UninterpretedOption uninterpreted_option = 999;
extensions 1000 to max;
reserved 8;
}
message FieldOptions {
optional CType ctype = 1 [default=STRING];
optional bool packed = 2;
optional JSType jstype = 6 [default=JS_NORMAL];
optional bool lazy = 5;
optional bool deprecated = 3;
optional bool weak = 10;
repeated UninterpretedOption uninterpreted_option = 999;
enum CType {
STRING = 0;
CORD = 1;
STRING_PIECE = 2;
}
enum JSType {
JS_NORMAL = 0;
JS_STRING = 1;
JS_NUMBER = 2;
}
extensions 1000 to max;
reserved 4;
}
message OneofOptions {
repeated UninterpretedOption uninterpreted_option = 999;
extensions 1000 to max;
}
message EnumOptions {
optional bool allow_alias = 2;
optional bool deprecated = 3;
repeated UninterpretedOption uninterpreted_option = 999;
extensions 1000 to max;
}
message EnumValueOptions {
optional bool deprecated = 1;
repeated UninterpretedOption uninterpreted_option = 999;
extensions 1000 to max;
}
message ServiceOptions {
optional bool deprecated = 33;
repeated UninterpretedOption uninterpreted_option = 999;
extensions 1000 to max;
}
message MethodOptions {
optional bool deprecated = 33;
repeated UninterpretedOption uninterpreted_option = 999;
extensions 1000 to max;
}
message UninterpretedOption {
repeated NamePart name = 2;
optional string identifier_value = 3;
optional uint64 positive_int_value = 4;
optional int64 negative_int_value = 5;
optional double double_value = 6;
optional bytes string_value = 7;
optional string aggregate_value = 8;
message NamePart {
required string name_part = 1;
required bool is_extension = 2;
}
}
message SourceCodeInfo {
repeated Location location = 1;
message Location {
repeated int32 path = 1 [packed=true];
repeated int32 span = 2 [packed=true];
optional string leading_comments = 3;
optional string trailing_comments = 4;
repeated string leading_detached_comments = 6;
}
}
message GeneratedCodeInfo {
repeated Annotation annotation = 1;
message Annotation {
repeated int32 path = 1 [packed=true];
optional string source_file = 2;
optional int32 begin = 3;
optional int32 end = 4;
}
}