protoc 1.0.0 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,826 +0,0 @@
1
- // Protocol Buffers - Google's data interchange format
2
- // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
4
- //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- // Author: kenton@google.com (Kenton Varda)
32
- // Based on original Protocol Buffers design by
33
- // Sanjay Ghemawat, Jeff Dean, and others.
34
- //
35
- // The messages in this file describe the definitions found in .proto files.
36
- // A valid .proto file can be translated directly to a FileDescriptorProto
37
- // without any other information (e.g. without reading its imports).
38
-
39
-
40
- syntax = "proto2";
41
-
42
- package google.protobuf;
43
- option go_package = "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor";
44
- option java_package = "com.google.protobuf";
45
- option java_outer_classname = "DescriptorProtos";
46
- option csharp_namespace = "Google.Protobuf.Reflection";
47
- option objc_class_prefix = "GPB";
48
-
49
- // descriptor.proto must be optimized for speed because reflection-based
50
- // algorithms don't work during bootstrapping.
51
- option optimize_for = SPEED;
52
-
53
- // The protocol compiler can output a FileDescriptorSet containing the .proto
54
- // files it parses.
55
- message FileDescriptorSet {
56
- repeated FileDescriptorProto file = 1;
57
- }
58
-
59
- // Describes a complete .proto file.
60
- message FileDescriptorProto {
61
- optional string name = 1; // file name, relative to root of source tree
62
- optional string package = 2; // e.g. "foo", "foo.bar", etc.
63
-
64
- // Names of files imported by this file.
65
- repeated string dependency = 3;
66
- // Indexes of the public imported files in the dependency list above.
67
- repeated int32 public_dependency = 10;
68
- // Indexes of the weak imported files in the dependency list.
69
- // For Google-internal migration only. Do not use.
70
- repeated int32 weak_dependency = 11;
71
-
72
- // All top-level definitions in this file.
73
- repeated DescriptorProto message_type = 4;
74
- repeated EnumDescriptorProto enum_type = 5;
75
- repeated ServiceDescriptorProto service = 6;
76
- repeated FieldDescriptorProto extension = 7;
77
-
78
- optional FileOptions options = 8;
79
-
80
- // This field contains optional information about the original source code.
81
- // You may safely remove this entire field without harming runtime
82
- // functionality of the descriptors -- the information is needed only by
83
- // development tools.
84
- optional SourceCodeInfo source_code_info = 9;
85
-
86
- // The syntax of the proto file.
87
- // The supported values are "proto2" and "proto3".
88
- optional string syntax = 12;
89
- }
90
-
91
- // Describes a message type.
92
- message DescriptorProto {
93
- optional string name = 1;
94
-
95
- repeated FieldDescriptorProto field = 2;
96
- repeated FieldDescriptorProto extension = 6;
97
-
98
- repeated DescriptorProto nested_type = 3;
99
- repeated EnumDescriptorProto enum_type = 4;
100
-
101
- message ExtensionRange {
102
- optional int32 start = 1;
103
- optional int32 end = 2;
104
- }
105
- repeated ExtensionRange extension_range = 5;
106
-
107
- repeated OneofDescriptorProto oneof_decl = 8;
108
-
109
- optional MessageOptions options = 7;
110
-
111
- // Range of reserved tag numbers. Reserved tag numbers may not be used by
112
- // fields or extension ranges in the same message. Reserved ranges may
113
- // not overlap.
114
- message ReservedRange {
115
- optional int32 start = 1; // Inclusive.
116
- optional int32 end = 2; // Exclusive.
117
- }
118
- repeated ReservedRange reserved_range = 9;
119
- // Reserved field names, which may not be used by fields in the same message.
120
- // A given name may only be reserved once.
121
- repeated string reserved_name = 10;
122
- }
123
-
124
- // Describes a field within a message.
125
- message FieldDescriptorProto {
126
- enum Type {
127
- // 0 is reserved for errors.
128
- // Order is weird for historical reasons.
129
- TYPE_DOUBLE = 1;
130
- TYPE_FLOAT = 2;
131
- // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
132
- // negative values are likely.
133
- TYPE_INT64 = 3;
134
- TYPE_UINT64 = 4;
135
- // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
136
- // negative values are likely.
137
- TYPE_INT32 = 5;
138
- TYPE_FIXED64 = 6;
139
- TYPE_FIXED32 = 7;
140
- TYPE_BOOL = 8;
141
- TYPE_STRING = 9;
142
- // Tag-delimited aggregate.
143
- // Group type is deprecated and not supported in proto3. However, Proto3
144
- // implementations should still be able to parse the group wire format and
145
- // treat group fields as unknown fields.
146
- TYPE_GROUP = 10;
147
- TYPE_MESSAGE = 11; // Length-delimited aggregate.
148
-
149
- // New in version 2.
150
- TYPE_BYTES = 12;
151
- TYPE_UINT32 = 13;
152
- TYPE_ENUM = 14;
153
- TYPE_SFIXED32 = 15;
154
- TYPE_SFIXED64 = 16;
155
- TYPE_SINT32 = 17; // Uses ZigZag encoding.
156
- TYPE_SINT64 = 18; // Uses ZigZag encoding.
157
- };
158
-
159
- enum Label {
160
- // 0 is reserved for errors
161
- LABEL_OPTIONAL = 1;
162
- LABEL_REQUIRED = 2;
163
- LABEL_REPEATED = 3;
164
- };
165
-
166
- optional string name = 1;
167
- optional int32 number = 3;
168
- optional Label label = 4;
169
-
170
- // If type_name is set, this need not be set. If both this and type_name
171
- // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
172
- optional Type type = 5;
173
-
174
- // For message and enum types, this is the name of the type. If the name
175
- // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
176
- // rules are used to find the type (i.e. first the nested types within this
177
- // message are searched, then within the parent, on up to the root
178
- // namespace).
179
- optional string type_name = 6;
180
-
181
- // For extensions, this is the name of the type being extended. It is
182
- // resolved in the same manner as type_name.
183
- optional string extendee = 2;
184
-
185
- // For numeric types, contains the original text representation of the value.
186
- // For booleans, "true" or "false".
187
- // For strings, contains the default text contents (not escaped in any way).
188
- // For bytes, contains the C escaped value. All bytes >= 128 are escaped.
189
- // TODO(kenton): Base-64 encode?
190
- optional string default_value = 7;
191
-
192
- // If set, gives the index of a oneof in the containing type's oneof_decl
193
- // list. This field is a member of that oneof.
194
- optional int32 oneof_index = 9;
195
-
196
- // JSON name of this field. The value is set by protocol compiler. If the
197
- // user has set a "json_name" option on this field, that option's value
198
- // will be used. Otherwise, it's deduced from the field's name by converting
199
- // it to camelCase.
200
- optional string json_name = 10;
201
-
202
- optional FieldOptions options = 8;
203
- }
204
-
205
- // Describes a oneof.
206
- message OneofDescriptorProto {
207
- optional string name = 1;
208
- optional OneofOptions options = 2;
209
- }
210
-
211
- // Describes an enum type.
212
- message EnumDescriptorProto {
213
- optional string name = 1;
214
-
215
- repeated EnumValueDescriptorProto value = 2;
216
-
217
- optional EnumOptions options = 3;
218
- }
219
-
220
- // Describes a value within an enum.
221
- message EnumValueDescriptorProto {
222
- optional string name = 1;
223
- optional int32 number = 2;
224
-
225
- optional EnumValueOptions options = 3;
226
- }
227
-
228
- // Describes a service.
229
- message ServiceDescriptorProto {
230
- optional string name = 1;
231
- repeated MethodDescriptorProto method = 2;
232
-
233
- optional ServiceOptions options = 3;
234
- }
235
-
236
- // Describes a method of a service.
237
- message MethodDescriptorProto {
238
- optional string name = 1;
239
-
240
- // Input and output type names. These are resolved in the same way as
241
- // FieldDescriptorProto.type_name, but must refer to a message type.
242
- optional string input_type = 2;
243
- optional string output_type = 3;
244
-
245
- optional MethodOptions options = 4;
246
-
247
- // Identifies if client streams multiple client messages
248
- optional bool client_streaming = 5 [default=false];
249
- // Identifies if server streams multiple server messages
250
- optional bool server_streaming = 6 [default=false];
251
- }
252
-
253
-
254
- // ===================================================================
255
- // Options
256
-
257
- // Each of the definitions above may have "options" attached. These are
258
- // just annotations which may cause code to be generated slightly differently
259
- // or may contain hints for code that manipulates protocol messages.
260
- //
261
- // Clients may define custom options as extensions of the *Options messages.
262
- // These extensions may not yet be known at parsing time, so the parser cannot
263
- // store the values in them. Instead it stores them in a field in the *Options
264
- // message called uninterpreted_option. This field must have the same name
265
- // across all *Options messages. We then use this field to populate the
266
- // extensions when we build a descriptor, at which point all protos have been
267
- // parsed and so all extensions are known.
268
- //
269
- // Extension numbers for custom options may be chosen as follows:
270
- // * For options which will only be used within a single application or
271
- // organization, or for experimental options, use field numbers 50000
272
- // through 99999. It is up to you to ensure that you do not use the
273
- // same number for multiple options.
274
- // * For options which will be published and used publicly by multiple
275
- // independent entities, e-mail protobuf-global-extension-registry@google.com
276
- // to reserve extension numbers. Simply provide your project name (e.g.
277
- // Objective-C plugin) and your project website (if available) -- there's no
278
- // need to explain how you intend to use them. Usually you only need one
279
- // extension number. You can declare multiple options with only one extension
280
- // number by putting them in a sub-message. See the Custom Options section of
281
- // the docs for examples:
282
- // https://developers.google.com/protocol-buffers/docs/proto#options
283
- // If this turns out to be popular, a web service will be set up
284
- // to automatically assign option numbers.
285
-
286
-
287
- message FileOptions {
288
-
289
- // Sets the Java package where classes generated from this .proto will be
290
- // placed. By default, the proto package is used, but this is often
291
- // inappropriate because proto packages do not normally start with backwards
292
- // domain names.
293
- optional string java_package = 1;
294
-
295
-
296
- // If set, all the classes from the .proto file are wrapped in a single
297
- // outer class with the given name. This applies to both Proto1
298
- // (equivalent to the old "--one_java_file" option) and Proto2 (where
299
- // a .proto always translates to a single class, but you may want to
300
- // explicitly choose the class name).
301
- optional string java_outer_classname = 8;
302
-
303
- // If set true, then the Java code generator will generate a separate .java
304
- // file for each top-level message, enum, and service defined in the .proto
305
- // file. Thus, these types will *not* be nested inside the outer class
306
- // named by java_outer_classname. However, the outer class will still be
307
- // generated to contain the file's getDescriptor() method as well as any
308
- // top-level extensions defined in the file.
309
- optional bool java_multiple_files = 10 [default=false];
310
-
311
- // This option does nothing.
312
- optional bool java_generate_equals_and_hash = 20 [deprecated=true];
313
-
314
- // If set true, then the Java2 code generator will generate code that
315
- // throws an exception whenever an attempt is made to assign a non-UTF-8
316
- // byte sequence to a string field.
317
- // Message reflection will do the same.
318
- // However, an extension field still accepts non-UTF-8 byte sequences.
319
- // This option has no effect on when used with the lite runtime.
320
- optional bool java_string_check_utf8 = 27 [default=false];
321
-
322
-
323
- // Generated classes can be optimized for speed or code size.
324
- enum OptimizeMode {
325
- SPEED = 1; // Generate complete code for parsing, serialization,
326
- // etc.
327
- CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
328
- LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
329
- }
330
- optional OptimizeMode optimize_for = 9 [default=SPEED];
331
-
332
- // Sets the Go package where structs generated from this .proto will be
333
- // placed. If omitted, the Go package will be derived from the following:
334
- // - The basename of the package import path, if provided.
335
- // - Otherwise, the package statement in the .proto file, if present.
336
- // - Otherwise, the basename of the .proto file, without extension.
337
- optional string go_package = 11;
338
-
339
-
340
-
341
- // Should generic services be generated in each language? "Generic" services
342
- // are not specific to any particular RPC system. They are generated by the
343
- // main code generators in each language (without additional plugins).
344
- // Generic services were the only kind of service generation supported by
345
- // early versions of google.protobuf.
346
- //
347
- // Generic services are now considered deprecated in favor of using plugins
348
- // that generate code specific to your particular RPC system. Therefore,
349
- // these default to false. Old code which depends on generic services should
350
- // explicitly set them to true.
351
- optional bool cc_generic_services = 16 [default=false];
352
- optional bool java_generic_services = 17 [default=false];
353
- optional bool py_generic_services = 18 [default=false];
354
-
355
- // Is this file deprecated?
356
- // Depending on the target platform, this can emit Deprecated annotations
357
- // for everything in the file, or it will be completely ignored; in the very
358
- // least, this is a formalization for deprecating files.
359
- optional bool deprecated = 23 [default=false];
360
-
361
- // Enables the use of arenas for the proto messages in this file. This applies
362
- // only to generated classes for C++.
363
- optional bool cc_enable_arenas = 31 [default=false];
364
-
365
-
366
- // Sets the objective c class prefix which is prepended to all objective c
367
- // generated classes from this .proto. There is no default.
368
- optional string objc_class_prefix = 36;
369
-
370
- // Namespace for generated classes; defaults to the package.
371
- optional string csharp_namespace = 37;
372
-
373
- // By default Swift generators will take the proto package and CamelCase it
374
- // replacing '.' with underscore and use that to prefix the types/symbols
375
- // defined. When this options is provided, they will use this value instead
376
- // to prefix the types/symbols defined.
377
- optional string swift_prefix = 39;
378
-
379
- // The parser stores options it doesn't recognize here. See above.
380
- repeated UninterpretedOption uninterpreted_option = 999;
381
-
382
- // Clients can define custom options in extensions of this message. See above.
383
- extensions 1000 to max;
384
-
385
- reserved 38;
386
- }
387
-
388
- message MessageOptions {
389
- // Set true to use the old proto1 MessageSet wire format for extensions.
390
- // This is provided for backwards-compatibility with the MessageSet wire
391
- // format. You should not use this for any other reason: It's less
392
- // efficient, has fewer features, and is more complicated.
393
- //
394
- // The message must be defined exactly as follows:
395
- // message Foo {
396
- // option message_set_wire_format = true;
397
- // extensions 4 to max;
398
- // }
399
- // Note that the message cannot have any defined fields; MessageSets only
400
- // have extensions.
401
- //
402
- // All extensions of your type must be singular messages; e.g. they cannot
403
- // be int32s, enums, or repeated messages.
404
- //
405
- // Because this is an option, the above two restrictions are not enforced by
406
- // the protocol compiler.
407
- optional bool message_set_wire_format = 1 [default=false];
408
-
409
- // Disables the generation of the standard "descriptor()" accessor, which can
410
- // conflict with a field of the same name. This is meant to make migration
411
- // from proto1 easier; new code should avoid fields named "descriptor".
412
- optional bool no_standard_descriptor_accessor = 2 [default=false];
413
-
414
- // Is this message deprecated?
415
- // Depending on the target platform, this can emit Deprecated annotations
416
- // for the message, or it will be completely ignored; in the very least,
417
- // this is a formalization for deprecating messages.
418
- optional bool deprecated = 3 [default=false];
419
-
420
- // Whether the message is an automatically generated map entry type for the
421
- // maps field.
422
- //
423
- // For maps fields:
424
- // map<KeyType, ValueType> map_field = 1;
425
- // The parsed descriptor looks like:
426
- // message MapFieldEntry {
427
- // option map_entry = true;
428
- // optional KeyType key = 1;
429
- // optional ValueType value = 2;
430
- // }
431
- // repeated MapFieldEntry map_field = 1;
432
- //
433
- // Implementations may choose not to generate the map_entry=true message, but
434
- // use a native map in the target language to hold the keys and values.
435
- // The reflection APIs in such implementions still need to work as
436
- // if the field is a repeated message field.
437
- //
438
- // NOTE: Do not set the option in .proto files. Always use the maps syntax
439
- // instead. The option should only be implicitly set by the proto compiler
440
- // parser.
441
- optional bool map_entry = 7;
442
-
443
- reserved 8; // javalite_serializable
444
-
445
-
446
- // The parser stores options it doesn't recognize here. See above.
447
- repeated UninterpretedOption uninterpreted_option = 999;
448
-
449
- // Clients can define custom options in extensions of this message. See above.
450
- extensions 1000 to max;
451
- }
452
-
453
- message FieldOptions {
454
- // The ctype option instructs the C++ code generator to use a different
455
- // representation of the field than it normally would. See the specific
456
- // options below. This option is not yet implemented in the open source
457
- // release -- sorry, we'll try to include it in a future version!
458
- optional CType ctype = 1 [default = STRING];
459
- enum CType {
460
- // Default mode.
461
- STRING = 0;
462
-
463
- CORD = 1;
464
-
465
- STRING_PIECE = 2;
466
- }
467
- // The packed option can be enabled for repeated primitive fields to enable
468
- // a more efficient representation on the wire. Rather than repeatedly
469
- // writing the tag and type for each element, the entire array is encoded as
470
- // a single length-delimited blob. In proto3, only explicit setting it to
471
- // false will avoid using packed encoding.
472
- optional bool packed = 2;
473
-
474
- // The jstype option determines the JavaScript type used for values of the
475
- // field. The option is permitted only for 64 bit integral and fixed types
476
- // (int64, uint64, sint64, fixed64, sfixed64). By default these types are
477
- // represented as JavaScript strings. This avoids loss of precision that can
478
- // happen when a large value is converted to a floating point JavaScript
479
- // numbers. Specifying JS_NUMBER for the jstype causes the generated
480
- // JavaScript code to use the JavaScript "number" type instead of strings.
481
- // This option is an enum to permit additional types to be added,
482
- // e.g. goog.math.Integer.
483
- optional JSType jstype = 6 [default = JS_NORMAL];
484
- enum JSType {
485
- // Use the default type.
486
- JS_NORMAL = 0;
487
-
488
- // Use JavaScript strings.
489
- JS_STRING = 1;
490
-
491
- // Use JavaScript numbers.
492
- JS_NUMBER = 2;
493
- }
494
-
495
- // Should this field be parsed lazily? Lazy applies only to message-type
496
- // fields. It means that when the outer message is initially parsed, the
497
- // inner message's contents will not be parsed but instead stored in encoded
498
- // form. The inner message will actually be parsed when it is first accessed.
499
- //
500
- // This is only a hint. Implementations are free to choose whether to use
501
- // eager or lazy parsing regardless of the value of this option. However,
502
- // setting this option true suggests that the protocol author believes that
503
- // using lazy parsing on this field is worth the additional bookkeeping
504
- // overhead typically needed to implement it.
505
- //
506
- // This option does not affect the public interface of any generated code;
507
- // all method signatures remain the same. Furthermore, thread-safety of the
508
- // interface is not affected by this option; const methods remain safe to
509
- // call from multiple threads concurrently, while non-const methods continue
510
- // to require exclusive access.
511
- //
512
- //
513
- // Note that implementations may choose not to check required fields within
514
- // a lazy sub-message. That is, calling IsInitialized() on the outer message
515
- // may return true even if the inner message has missing required fields.
516
- // This is necessary because otherwise the inner message would have to be
517
- // parsed in order to perform the check, defeating the purpose of lazy
518
- // parsing. An implementation which chooses not to check required fields
519
- // must be consistent about it. That is, for any particular sub-message, the
520
- // implementation must either *always* check its required fields, or *never*
521
- // check its required fields, regardless of whether or not the message has
522
- // been parsed.
523
- optional bool lazy = 5 [default=false];
524
-
525
- // Is this field deprecated?
526
- // Depending on the target platform, this can emit Deprecated annotations
527
- // for accessors, or it will be completely ignored; in the very least, this
528
- // is a formalization for deprecating fields.
529
- optional bool deprecated = 3 [default=false];
530
-
531
- // For Google-internal migration only. Do not use.
532
- optional bool weak = 10 [default=false];
533
-
534
-
535
- // The parser stores options it doesn't recognize here. See above.
536
- repeated UninterpretedOption uninterpreted_option = 999;
537
-
538
- // Clients can define custom options in extensions of this message. See above.
539
- extensions 1000 to max;
540
-
541
- reserved 4; // removed jtype
542
- }
543
-
544
- message OneofOptions {
545
- // The parser stores options it doesn't recognize here. See above.
546
- repeated UninterpretedOption uninterpreted_option = 999;
547
-
548
- // Clients can define custom options in extensions of this message. See above.
549
- extensions 1000 to max;
550
- }
551
-
552
- message EnumOptions {
553
-
554
- // Set this option to true to allow mapping different tag names to the same
555
- // value.
556
- optional bool allow_alias = 2;
557
-
558
- // Is this enum deprecated?
559
- // Depending on the target platform, this can emit Deprecated annotations
560
- // for the enum, or it will be completely ignored; in the very least, this
561
- // is a formalization for deprecating enums.
562
- optional bool deprecated = 3 [default=false];
563
-
564
-
565
- // The parser stores options it doesn't recognize here. See above.
566
- repeated UninterpretedOption uninterpreted_option = 999;
567
-
568
- // Clients can define custom options in extensions of this message. See above.
569
- extensions 1000 to max;
570
- }
571
-
572
- message EnumValueOptions {
573
- // Is this enum value deprecated?
574
- // Depending on the target platform, this can emit Deprecated annotations
575
- // for the enum value, or it will be completely ignored; in the very least,
576
- // this is a formalization for deprecating enum values.
577
- optional bool deprecated = 1 [default=false];
578
-
579
- // The parser stores options it doesn't recognize here. See above.
580
- repeated UninterpretedOption uninterpreted_option = 999;
581
-
582
- // Clients can define custom options in extensions of this message. See above.
583
- extensions 1000 to max;
584
- }
585
-
586
- message ServiceOptions {
587
-
588
- // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
589
- // framework. We apologize for hoarding these numbers to ourselves, but
590
- // we were already using them long before we decided to release Protocol
591
- // Buffers.
592
-
593
- // Is this service deprecated?
594
- // Depending on the target platform, this can emit Deprecated annotations
595
- // for the service, or it will be completely ignored; in the very least,
596
- // this is a formalization for deprecating services.
597
- optional bool deprecated = 33 [default=false];
598
-
599
- // The parser stores options it doesn't recognize here. See above.
600
- repeated UninterpretedOption uninterpreted_option = 999;
601
-
602
- // Clients can define custom options in extensions of this message. See above.
603
- extensions 1000 to max;
604
- }
605
-
606
- message MethodOptions {
607
-
608
- // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
609
- // framework. We apologize for hoarding these numbers to ourselves, but
610
- // we were already using them long before we decided to release Protocol
611
- // Buffers.
612
-
613
- // Is this method deprecated?
614
- // Depending on the target platform, this can emit Deprecated annotations
615
- // for the method, or it will be completely ignored; in the very least,
616
- // this is a formalization for deprecating methods.
617
- optional bool deprecated = 33 [default=false];
618
-
619
- // Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
620
- // or neither? HTTP based RPC implementation may choose GET verb for safe
621
- // methods, and PUT verb for idempotent methods instead of the default POST.
622
- enum IdempotencyLevel {
623
- IDEMPOTENCY_UNKNOWN = 0;
624
- NO_SIDE_EFFECTS = 1; // implies idempotent
625
- IDEMPOTENT = 2; // idempotent, but may have side effects
626
- }
627
- optional IdempotencyLevel idempotency_level =
628
- 34 [default=IDEMPOTENCY_UNKNOWN];
629
-
630
- // The parser stores options it doesn't recognize here. See above.
631
- repeated UninterpretedOption uninterpreted_option = 999;
632
-
633
- // Clients can define custom options in extensions of this message. See above.
634
- extensions 1000 to max;
635
- }
636
-
637
-
638
- // A message representing a option the parser does not recognize. This only
639
- // appears in options protos created by the compiler::Parser class.
640
- // DescriptorPool resolves these when building Descriptor objects. Therefore,
641
- // options protos in descriptor objects (e.g. returned by Descriptor::options(),
642
- // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
643
- // in them.
644
- message UninterpretedOption {
645
- // The name of the uninterpreted option. Each string represents a segment in
646
- // a dot-separated name. is_extension is true iff a segment represents an
647
- // extension (denoted with parentheses in options specs in .proto files).
648
- // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
649
- // "foo.(bar.baz).qux".
650
- message NamePart {
651
- required string name_part = 1;
652
- required bool is_extension = 2;
653
- }
654
- repeated NamePart name = 2;
655
-
656
- // The value of the uninterpreted option, in whatever type the tokenizer
657
- // identified it as during parsing. Exactly one of these should be set.
658
- optional string identifier_value = 3;
659
- optional uint64 positive_int_value = 4;
660
- optional int64 negative_int_value = 5;
661
- optional double double_value = 6;
662
- optional bytes string_value = 7;
663
- optional string aggregate_value = 8;
664
- }
665
-
666
- // ===================================================================
667
- // Optional source code info
668
-
669
- // Encapsulates information about the original source file from which a
670
- // FileDescriptorProto was generated.
671
- message SourceCodeInfo {
672
- // A Location identifies a piece of source code in a .proto file which
673
- // corresponds to a particular definition. This information is intended
674
- // to be useful to IDEs, code indexers, documentation generators, and similar
675
- // tools.
676
- //
677
- // For example, say we have a file like:
678
- // message Foo {
679
- // optional string foo = 1;
680
- // }
681
- // Let's look at just the field definition:
682
- // optional string foo = 1;
683
- // ^ ^^ ^^ ^ ^^^
684
- // a bc de f ghi
685
- // We have the following locations:
686
- // span path represents
687
- // [a,i) [ 4, 0, 2, 0 ] The whole field definition.
688
- // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
689
- // [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
690
- // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
691
- // [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
692
- //
693
- // Notes:
694
- // - A location may refer to a repeated field itself (i.e. not to any
695
- // particular index within it). This is used whenever a set of elements are
696
- // logically enclosed in a single code segment. For example, an entire
697
- // extend block (possibly containing multiple extension definitions) will
698
- // have an outer location whose path refers to the "extensions" repeated
699
- // field without an index.
700
- // - Multiple locations may have the same path. This happens when a single
701
- // logical declaration is spread out across multiple places. The most
702
- // obvious example is the "extend" block again -- there may be multiple
703
- // extend blocks in the same scope, each of which will have the same path.
704
- // - A location's span is not always a subset of its parent's span. For
705
- // example, the "extendee" of an extension declaration appears at the
706
- // beginning of the "extend" block and is shared by all extensions within
707
- // the block.
708
- // - Just because a location's span is a subset of some other location's span
709
- // does not mean that it is a descendent. For example, a "group" defines
710
- // both a type and a field in a single declaration. Thus, the locations
711
- // corresponding to the type and field and their components will overlap.
712
- // - Code which tries to interpret locations should probably be designed to
713
- // ignore those that it doesn't understand, as more types of locations could
714
- // be recorded in the future.
715
- repeated Location location = 1;
716
- message Location {
717
- // Identifies which part of the FileDescriptorProto was defined at this
718
- // location.
719
- //
720
- // Each element is a field number or an index. They form a path from
721
- // the root FileDescriptorProto to the place where the definition. For
722
- // example, this path:
723
- // [ 4, 3, 2, 7, 1 ]
724
- // refers to:
725
- // file.message_type(3) // 4, 3
726
- // .field(7) // 2, 7
727
- // .name() // 1
728
- // This is because FileDescriptorProto.message_type has field number 4:
729
- // repeated DescriptorProto message_type = 4;
730
- // and DescriptorProto.field has field number 2:
731
- // repeated FieldDescriptorProto field = 2;
732
- // and FieldDescriptorProto.name has field number 1:
733
- // optional string name = 1;
734
- //
735
- // Thus, the above path gives the location of a field name. If we removed
736
- // the last element:
737
- // [ 4, 3, 2, 7 ]
738
- // this path refers to the whole field declaration (from the beginning
739
- // of the label to the terminating semicolon).
740
- repeated int32 path = 1 [packed=true];
741
-
742
- // Always has exactly three or four elements: start line, start column,
743
- // end line (optional, otherwise assumed same as start line), end column.
744
- // These are packed into a single field for efficiency. Note that line
745
- // and column numbers are zero-based -- typically you will want to add
746
- // 1 to each before displaying to a user.
747
- repeated int32 span = 2 [packed=true];
748
-
749
- // If this SourceCodeInfo represents a complete declaration, these are any
750
- // comments appearing before and after the declaration which appear to be
751
- // attached to the declaration.
752
- //
753
- // A series of line comments appearing on consecutive lines, with no other
754
- // tokens appearing on those lines, will be treated as a single comment.
755
- //
756
- // leading_detached_comments will keep paragraphs of comments that appear
757
- // before (but not connected to) the current element. Each paragraph,
758
- // separated by empty lines, will be one comment element in the repeated
759
- // field.
760
- //
761
- // Only the comment content is provided; comment markers (e.g. //) are
762
- // stripped out. For block comments, leading whitespace and an asterisk
763
- // will be stripped from the beginning of each line other than the first.
764
- // Newlines are included in the output.
765
- //
766
- // Examples:
767
- //
768
- // optional int32 foo = 1; // Comment attached to foo.
769
- // // Comment attached to bar.
770
- // optional int32 bar = 2;
771
- //
772
- // optional string baz = 3;
773
- // // Comment attached to baz.
774
- // // Another line attached to baz.
775
- //
776
- // // Comment attached to qux.
777
- // //
778
- // // Another line attached to qux.
779
- // optional double qux = 4;
780
- //
781
- // // Detached comment for corge. This is not leading or trailing comments
782
- // // to qux or corge because there are blank lines separating it from
783
- // // both.
784
- //
785
- // // Detached comment for corge paragraph 2.
786
- //
787
- // optional string corge = 5;
788
- // /* Block comment attached
789
- // * to corge. Leading asterisks
790
- // * will be removed. */
791
- // /* Block comment attached to
792
- // * grault. */
793
- // optional int32 grault = 6;
794
- //
795
- // // ignored detached comments.
796
- optional string leading_comments = 3;
797
- optional string trailing_comments = 4;
798
- repeated string leading_detached_comments = 6;
799
- }
800
- }
801
-
802
- // Describes the relationship between generated code and its original source
803
- // file. A GeneratedCodeInfo message is associated with only one generated
804
- // source file, but may contain references to different source .proto files.
805
- message GeneratedCodeInfo {
806
- // An Annotation connects some span of text in generated code to an element
807
- // of its generating .proto file.
808
- repeated Annotation annotation = 1;
809
- message Annotation {
810
- // Identifies the element in the original source .proto file. This field
811
- // is formatted the same as SourceCodeInfo.Location.path.
812
- repeated int32 path = 1 [packed=true];
813
-
814
- // Identifies the filesystem path to the original source .proto.
815
- optional string source_file = 2;
816
-
817
- // Identifies the starting offset in bytes in the generated code
818
- // that relates to the identified object.
819
- optional int32 begin = 3;
820
-
821
- // Identifies the ending offset in bytes in the generated code that
822
- // relates to the identified offset. The end offset should be one past
823
- // the last relevant byte (so the length of the text = end - begin).
824
- optional int32 end = 4;
825
- }
826
- }