grpc-tools 0.14.1 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/x86-linux/google/protobuf/any.proto +130 -0
- data/bin/x86-linux/google/protobuf/api.proto +202 -0
- data/bin/x86-linux/google/protobuf/compiler/plugin.proto +150 -0
- data/bin/x86-linux/google/protobuf/descriptor.proto +803 -0
- data/bin/x86-linux/google/protobuf/duration.proto +98 -0
- data/bin/x86-linux/google/protobuf/empty.proto +53 -0
- data/bin/x86-linux/google/protobuf/field_mask.proto +194 -0
- data/bin/x86-linux/google/protobuf/source_context.proto +48 -0
- data/bin/x86-linux/google/protobuf/struct.proto +96 -0
- data/bin/x86-linux/google/protobuf/timestamp.proto +111 -0
- data/bin/x86-linux/google/protobuf/type.proto +180 -0
- data/bin/x86-linux/google/protobuf/wrappers.proto +119 -0
- data/bin/x86-linux/grpc_ruby_plugin +0 -0
- data/bin/x86-linux/protoc +0 -0
- data/bin/x86-macos/google/protobuf/any.proto +130 -0
- data/bin/x86-macos/google/protobuf/api.proto +202 -0
- data/bin/x86-macos/google/protobuf/compiler/plugin.proto +150 -0
- data/bin/x86-macos/google/protobuf/descriptor.proto +803 -0
- data/bin/x86-macos/google/protobuf/duration.proto +98 -0
- data/bin/x86-macos/google/protobuf/empty.proto +53 -0
- data/bin/x86-macos/google/protobuf/field_mask.proto +194 -0
- data/bin/x86-macos/google/protobuf/source_context.proto +48 -0
- data/bin/x86-macos/google/protobuf/struct.proto +96 -0
- data/bin/x86-macos/google/protobuf/timestamp.proto +111 -0
- data/bin/x86-macos/google/protobuf/type.proto +180 -0
- data/bin/x86-macos/google/protobuf/wrappers.proto +119 -0
- data/bin/x86-macos/grpc_ruby_plugin +0 -0
- data/bin/x86-macos/protoc +0 -0
- data/bin/x86-windows/google/protobuf/any.proto +130 -0
- data/bin/x86-windows/google/protobuf/api.proto +202 -0
- data/bin/x86-windows/google/protobuf/compiler/plugin.proto +150 -0
- data/bin/x86-windows/google/protobuf/descriptor.proto +803 -0
- data/bin/x86-windows/google/protobuf/duration.proto +98 -0
- data/bin/x86-windows/google/protobuf/empty.proto +53 -0
- data/bin/x86-windows/google/protobuf/field_mask.proto +194 -0
- data/bin/x86-windows/google/protobuf/source_context.proto +48 -0
- data/bin/x86-windows/google/protobuf/struct.proto +96 -0
- data/bin/x86-windows/google/protobuf/timestamp.proto +111 -0
- data/bin/x86-windows/google/protobuf/type.proto +180 -0
- data/bin/x86-windows/google/protobuf/wrappers.proto +119 -0
- data/bin/x86-windows/grpc_ruby_plugin.exe +0 -0
- data/bin/x86-windows/protoc.exe +0 -0
- data/bin/x86_64-linux/google/protobuf/any.proto +130 -0
- data/bin/x86_64-linux/google/protobuf/api.proto +202 -0
- data/bin/x86_64-linux/google/protobuf/compiler/plugin.proto +150 -0
- data/bin/x86_64-linux/google/protobuf/descriptor.proto +803 -0
- data/bin/x86_64-linux/google/protobuf/duration.proto +98 -0
- data/bin/x86_64-linux/google/protobuf/empty.proto +53 -0
- data/bin/x86_64-linux/google/protobuf/field_mask.proto +194 -0
- data/bin/x86_64-linux/google/protobuf/source_context.proto +48 -0
- data/bin/x86_64-linux/google/protobuf/struct.proto +96 -0
- data/bin/x86_64-linux/google/protobuf/timestamp.proto +111 -0
- data/bin/x86_64-linux/google/protobuf/type.proto +180 -0
- data/bin/x86_64-linux/google/protobuf/wrappers.proto +119 -0
- data/bin/x86_64-linux/grpc_ruby_plugin +0 -0
- data/bin/x86_64-linux/protoc +0 -0
- data/bin/x86_64-macos/google/protobuf/any.proto +130 -0
- data/bin/x86_64-macos/google/protobuf/api.proto +202 -0
- data/bin/x86_64-macos/google/protobuf/compiler/plugin.proto +150 -0
- data/bin/x86_64-macos/google/protobuf/descriptor.proto +803 -0
- data/bin/x86_64-macos/google/protobuf/duration.proto +98 -0
- data/bin/x86_64-macos/google/protobuf/empty.proto +53 -0
- data/bin/x86_64-macos/google/protobuf/field_mask.proto +194 -0
- data/bin/x86_64-macos/google/protobuf/source_context.proto +48 -0
- data/bin/x86_64-macos/google/protobuf/struct.proto +96 -0
- data/bin/x86_64-macos/google/protobuf/timestamp.proto +111 -0
- data/bin/x86_64-macos/google/protobuf/type.proto +180 -0
- data/bin/x86_64-macos/google/protobuf/wrappers.proto +119 -0
- data/bin/x86_64-macos/grpc_ruby_plugin +0 -0
- data/bin/x86_64-macos/protoc +0 -0
- data/bin/x86_64-windows/google/protobuf/any.proto +130 -0
- data/bin/x86_64-windows/google/protobuf/api.proto +202 -0
- data/bin/x86_64-windows/google/protobuf/compiler/plugin.proto +150 -0
- data/bin/x86_64-windows/google/protobuf/descriptor.proto +803 -0
- data/bin/x86_64-windows/google/protobuf/duration.proto +98 -0
- data/bin/x86_64-windows/google/protobuf/empty.proto +53 -0
- data/bin/x86_64-windows/google/protobuf/field_mask.proto +194 -0
- data/bin/x86_64-windows/google/protobuf/source_context.proto +48 -0
- data/bin/x86_64-windows/google/protobuf/struct.proto +96 -0
- data/bin/x86_64-windows/google/protobuf/timestamp.proto +111 -0
- data/bin/x86_64-windows/google/protobuf/type.proto +180 -0
- data/bin/x86_64-windows/google/protobuf/wrappers.proto +119 -0
- data/bin/x86_64-windows/grpc_ruby_plugin.exe +0 -0
- data/bin/x86_64-windows/protoc.exe +0 -0
- data/version.rb +1 -1
- metadata +74 -2
@@ -0,0 +1,202 @@
|
|
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
|
+
syntax = "proto3";
|
32
|
+
|
33
|
+
package google.protobuf;
|
34
|
+
|
35
|
+
import "google/protobuf/source_context.proto";
|
36
|
+
import "google/protobuf/type.proto";
|
37
|
+
|
38
|
+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
39
|
+
option java_package = "com.google.protobuf";
|
40
|
+
option java_outer_classname = "ApiProto";
|
41
|
+
option java_multiple_files = true;
|
42
|
+
option java_generate_equals_and_hash = true;
|
43
|
+
option objc_class_prefix = "GPB";
|
44
|
+
|
45
|
+
// Api is a light-weight descriptor for a protocol buffer service.
|
46
|
+
message Api {
|
47
|
+
|
48
|
+
// The fully qualified name of this api, including package name
|
49
|
+
// followed by the api's simple name.
|
50
|
+
string name = 1;
|
51
|
+
|
52
|
+
// The methods of this api, in unspecified order.
|
53
|
+
repeated Method methods = 2;
|
54
|
+
|
55
|
+
// Any metadata attached to the API.
|
56
|
+
repeated Option options = 3;
|
57
|
+
|
58
|
+
// A version string for this api. If specified, must have the form
|
59
|
+
// `major-version.minor-version`, as in `1.10`. If the minor version
|
60
|
+
// is omitted, it defaults to zero. If the entire version field is
|
61
|
+
// empty, the major version is derived from the package name, as
|
62
|
+
// outlined below. If the field is not empty, the version in the
|
63
|
+
// package name will be verified to be consistent with what is
|
64
|
+
// provided here.
|
65
|
+
//
|
66
|
+
// The versioning schema uses [semantic
|
67
|
+
// versioning](http://semver.org) where the major version number
|
68
|
+
// indicates a breaking change and the minor version an additive,
|
69
|
+
// non-breaking change. Both version numbers are signals to users
|
70
|
+
// what to expect from different versions, and should be carefully
|
71
|
+
// chosen based on the product plan.
|
72
|
+
//
|
73
|
+
// The major version is also reflected in the package name of the
|
74
|
+
// API, which must end in `v<major-version>`, as in
|
75
|
+
// `google.feature.v1`. For major versions 0 and 1, the suffix can
|
76
|
+
// be omitted. Zero major versions must only be used for
|
77
|
+
// experimental, none-GA apis.
|
78
|
+
//
|
79
|
+
//
|
80
|
+
string version = 4;
|
81
|
+
|
82
|
+
// Source context for the protocol buffer service represented by this
|
83
|
+
// message.
|
84
|
+
SourceContext source_context = 5;
|
85
|
+
|
86
|
+
// Included APIs. See [Mixin][].
|
87
|
+
repeated Mixin mixins = 6;
|
88
|
+
|
89
|
+
// The source syntax of the service.
|
90
|
+
Syntax syntax = 7;
|
91
|
+
}
|
92
|
+
|
93
|
+
// Method represents a method of an api.
|
94
|
+
message Method {
|
95
|
+
|
96
|
+
// The simple name of this method.
|
97
|
+
string name = 1;
|
98
|
+
|
99
|
+
// A URL of the input message type.
|
100
|
+
string request_type_url = 2;
|
101
|
+
|
102
|
+
// If true, the request is streamed.
|
103
|
+
bool request_streaming = 3;
|
104
|
+
|
105
|
+
// The URL of the output message type.
|
106
|
+
string response_type_url = 4;
|
107
|
+
|
108
|
+
// If true, the response is streamed.
|
109
|
+
bool response_streaming = 5;
|
110
|
+
|
111
|
+
// Any metadata attached to the method.
|
112
|
+
repeated Option options = 6;
|
113
|
+
|
114
|
+
// The source syntax of this method.
|
115
|
+
Syntax syntax = 7;
|
116
|
+
}
|
117
|
+
|
118
|
+
// Declares an API to be included in this API. The including API must
|
119
|
+
// redeclare all the methods from the included API, but documentation
|
120
|
+
// and options are inherited as follows:
|
121
|
+
//
|
122
|
+
// - If after comment and whitespace stripping, the documentation
|
123
|
+
// string of the redeclared method is empty, it will be inherited
|
124
|
+
// from the original method.
|
125
|
+
//
|
126
|
+
// - Each annotation belonging to the service config (http,
|
127
|
+
// visibility) which is not set in the redeclared method will be
|
128
|
+
// inherited.
|
129
|
+
//
|
130
|
+
// - If an http annotation is inherited, the path pattern will be
|
131
|
+
// modified as follows. Any version prefix will be replaced by the
|
132
|
+
// version of the including API plus the [root][] path if specified.
|
133
|
+
//
|
134
|
+
// Example of a simple mixin:
|
135
|
+
//
|
136
|
+
// package google.acl.v1;
|
137
|
+
// service AccessControl {
|
138
|
+
// // Get the underlying ACL object.
|
139
|
+
// rpc GetAcl(GetAclRequest) returns (Acl) {
|
140
|
+
// option (google.api.http).get = "/v1/{resource=**}:getAcl";
|
141
|
+
// }
|
142
|
+
// }
|
143
|
+
//
|
144
|
+
// package google.storage.v2;
|
145
|
+
// service Storage {
|
146
|
+
// rpc GetAcl(GetAclRequest) returns (Acl);
|
147
|
+
//
|
148
|
+
// // Get a data record.
|
149
|
+
// rpc GetData(GetDataRequest) returns (Data) {
|
150
|
+
// option (google.api.http).get = "/v2/{resource=**}";
|
151
|
+
// }
|
152
|
+
// }
|
153
|
+
//
|
154
|
+
// Example of a mixin configuration:
|
155
|
+
//
|
156
|
+
// apis:
|
157
|
+
// - name: google.storage.v2.Storage
|
158
|
+
// mixins:
|
159
|
+
// - name: google.acl.v1.AccessControl
|
160
|
+
//
|
161
|
+
// The mixin construct implies that all methods in `AccessControl` are
|
162
|
+
// also declared with same name and request/response types in
|
163
|
+
// `Storage`. A documentation generator or annotation processor will
|
164
|
+
// see the effective `Storage.GetAcl` method after inherting
|
165
|
+
// documentation and annotations as follows:
|
166
|
+
//
|
167
|
+
// service Storage {
|
168
|
+
// // Get the underlying ACL object.
|
169
|
+
// rpc GetAcl(GetAclRequest) returns (Acl) {
|
170
|
+
// option (google.api.http).get = "/v2/{resource=**}:getAcl";
|
171
|
+
// }
|
172
|
+
// ...
|
173
|
+
// }
|
174
|
+
//
|
175
|
+
// Note how the version in the path pattern changed from `v1` to `v2`.
|
176
|
+
//
|
177
|
+
// If the `root` field in the mixin is specified, it should be a
|
178
|
+
// relative path under which inherited HTTP paths are placed. Example:
|
179
|
+
//
|
180
|
+
// apis:
|
181
|
+
// - name: google.storage.v2.Storage
|
182
|
+
// mixins:
|
183
|
+
// - name: google.acl.v1.AccessControl
|
184
|
+
// root: acls
|
185
|
+
//
|
186
|
+
// This implies the following inherited HTTP annotation:
|
187
|
+
//
|
188
|
+
// service Storage {
|
189
|
+
// // Get the underlying ACL object.
|
190
|
+
// rpc GetAcl(GetAclRequest) returns (Acl) {
|
191
|
+
// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
|
192
|
+
// }
|
193
|
+
// ...
|
194
|
+
// }
|
195
|
+
message Mixin {
|
196
|
+
// The fully qualified name of the API which is included.
|
197
|
+
string name = 1;
|
198
|
+
|
199
|
+
// If non-empty specifies a path under which inherited HTTP paths
|
200
|
+
// are rooted.
|
201
|
+
string root = 2;
|
202
|
+
}
|
@@ -0,0 +1,150 @@
|
|
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
|
+
//
|
33
|
+
// WARNING: The plugin interface is currently EXPERIMENTAL and is subject to
|
34
|
+
// change.
|
35
|
+
//
|
36
|
+
// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is
|
37
|
+
// just a program that reads a CodeGeneratorRequest from stdin and writes a
|
38
|
+
// CodeGeneratorResponse to stdout.
|
39
|
+
//
|
40
|
+
// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead
|
41
|
+
// of dealing with the raw protocol defined here.
|
42
|
+
//
|
43
|
+
// A plugin executable needs only to be placed somewhere in the path. The
|
44
|
+
// plugin should be named "protoc-gen-$NAME", and will then be used when the
|
45
|
+
// flag "--${NAME}_out" is passed to protoc.
|
46
|
+
|
47
|
+
syntax = "proto2";
|
48
|
+
package google.protobuf.compiler;
|
49
|
+
option java_package = "com.google.protobuf.compiler";
|
50
|
+
option java_outer_classname = "PluginProtos";
|
51
|
+
|
52
|
+
option go_package = "plugin_go";
|
53
|
+
|
54
|
+
import "google/protobuf/descriptor.proto";
|
55
|
+
|
56
|
+
// An encoded CodeGeneratorRequest is written to the plugin's stdin.
|
57
|
+
message CodeGeneratorRequest {
|
58
|
+
// The .proto files that were explicitly listed on the command-line. The
|
59
|
+
// code generator should generate code only for these files. Each file's
|
60
|
+
// descriptor will be included in proto_file, below.
|
61
|
+
repeated string file_to_generate = 1;
|
62
|
+
|
63
|
+
// The generator parameter passed on the command-line.
|
64
|
+
optional string parameter = 2;
|
65
|
+
|
66
|
+
// FileDescriptorProtos for all files in files_to_generate and everything
|
67
|
+
// they import. The files will appear in topological order, so each file
|
68
|
+
// appears before any file that imports it.
|
69
|
+
//
|
70
|
+
// protoc guarantees that all proto_files will be written after
|
71
|
+
// the fields above, even though this is not technically guaranteed by the
|
72
|
+
// protobuf wire format. This theoretically could allow a plugin to stream
|
73
|
+
// in the FileDescriptorProtos and handle them one by one rather than read
|
74
|
+
// the entire set into memory at once. However, as of this writing, this
|
75
|
+
// is not similarly optimized on protoc's end -- it will store all fields in
|
76
|
+
// memory at once before sending them to the plugin.
|
77
|
+
repeated FileDescriptorProto proto_file = 15;
|
78
|
+
}
|
79
|
+
|
80
|
+
// The plugin writes an encoded CodeGeneratorResponse to stdout.
|
81
|
+
message CodeGeneratorResponse {
|
82
|
+
// Error message. If non-empty, code generation failed. The plugin process
|
83
|
+
// should exit with status code zero even if it reports an error in this way.
|
84
|
+
//
|
85
|
+
// This should be used to indicate errors in .proto files which prevent the
|
86
|
+
// code generator from generating correct code. Errors which indicate a
|
87
|
+
// problem in protoc itself -- such as the input CodeGeneratorRequest being
|
88
|
+
// unparseable -- should be reported by writing a message to stderr and
|
89
|
+
// exiting with a non-zero status code.
|
90
|
+
optional string error = 1;
|
91
|
+
|
92
|
+
// Represents a single generated file.
|
93
|
+
message File {
|
94
|
+
// The file name, relative to the output directory. The name must not
|
95
|
+
// contain "." or ".." components and must be relative, not be absolute (so,
|
96
|
+
// the file cannot lie outside the output directory). "/" must be used as
|
97
|
+
// the path separator, not "\".
|
98
|
+
//
|
99
|
+
// If the name is omitted, the content will be appended to the previous
|
100
|
+
// file. This allows the generator to break large files into small chunks,
|
101
|
+
// and allows the generated text to be streamed back to protoc so that large
|
102
|
+
// files need not reside completely in memory at one time. Note that as of
|
103
|
+
// this writing protoc does not optimize for this -- it will read the entire
|
104
|
+
// CodeGeneratorResponse before writing files to disk.
|
105
|
+
optional string name = 1;
|
106
|
+
|
107
|
+
// If non-empty, indicates that the named file should already exist, and the
|
108
|
+
// content here is to be inserted into that file at a defined insertion
|
109
|
+
// point. This feature allows a code generator to extend the output
|
110
|
+
// produced by another code generator. The original generator may provide
|
111
|
+
// insertion points by placing special annotations in the file that look
|
112
|
+
// like:
|
113
|
+
// @@protoc_insertion_point(NAME)
|
114
|
+
// The annotation can have arbitrary text before and after it on the line,
|
115
|
+
// which allows it to be placed in a comment. NAME should be replaced with
|
116
|
+
// an identifier naming the point -- this is what other generators will use
|
117
|
+
// as the insertion_point. Code inserted at this point will be placed
|
118
|
+
// immediately above the line containing the insertion point (thus multiple
|
119
|
+
// insertions to the same point will come out in the order they were added).
|
120
|
+
// The double-@ is intended to make it unlikely that the generated code
|
121
|
+
// could contain things that look like insertion points by accident.
|
122
|
+
//
|
123
|
+
// For example, the C++ code generator places the following line in the
|
124
|
+
// .pb.h files that it generates:
|
125
|
+
// // @@protoc_insertion_point(namespace_scope)
|
126
|
+
// This line appears within the scope of the file's package namespace, but
|
127
|
+
// outside of any particular class. Another plugin can then specify the
|
128
|
+
// insertion_point "namespace_scope" to generate additional classes or
|
129
|
+
// other declarations that should be placed in this scope.
|
130
|
+
//
|
131
|
+
// Note that if the line containing the insertion point begins with
|
132
|
+
// whitespace, the same whitespace will be added to every line of the
|
133
|
+
// inserted text. This is useful for languages like Python, where
|
134
|
+
// indentation matters. In these languages, the insertion point comment
|
135
|
+
// should be indented the same amount as any inserted code will need to be
|
136
|
+
// in order to work correctly in that context.
|
137
|
+
//
|
138
|
+
// The code generator that generates the initial file and the one which
|
139
|
+
// inserts into it must both run as part of a single invocation of protoc.
|
140
|
+
// Code generators are executed in the order in which they appear on the
|
141
|
+
// command line.
|
142
|
+
//
|
143
|
+
// If |insertion_point| is present, |name| must also be present.
|
144
|
+
optional string insertion_point = 2;
|
145
|
+
|
146
|
+
// The file contents.
|
147
|
+
optional string content = 15;
|
148
|
+
}
|
149
|
+
repeated File file = 15;
|
150
|
+
}
|
@@ -0,0 +1,803 @@
|
|
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 = "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
|
+
TYPE_GROUP = 10; // Tag-delimited aggregate.
|
143
|
+
TYPE_MESSAGE = 11; // Length-delimited aggregate.
|
144
|
+
|
145
|
+
// New in version 2.
|
146
|
+
TYPE_BYTES = 12;
|
147
|
+
TYPE_UINT32 = 13;
|
148
|
+
TYPE_ENUM = 14;
|
149
|
+
TYPE_SFIXED32 = 15;
|
150
|
+
TYPE_SFIXED64 = 16;
|
151
|
+
TYPE_SINT32 = 17; // Uses ZigZag encoding.
|
152
|
+
TYPE_SINT64 = 18; // Uses ZigZag encoding.
|
153
|
+
};
|
154
|
+
|
155
|
+
enum Label {
|
156
|
+
// 0 is reserved for errors
|
157
|
+
LABEL_OPTIONAL = 1;
|
158
|
+
LABEL_REQUIRED = 2;
|
159
|
+
LABEL_REPEATED = 3;
|
160
|
+
// TODO(sanjay): Should we add LABEL_MAP?
|
161
|
+
};
|
162
|
+
|
163
|
+
optional string name = 1;
|
164
|
+
optional int32 number = 3;
|
165
|
+
optional Label label = 4;
|
166
|
+
|
167
|
+
// If type_name is set, this need not be set. If both this and type_name
|
168
|
+
// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
|
169
|
+
optional Type type = 5;
|
170
|
+
|
171
|
+
// For message and enum types, this is the name of the type. If the name
|
172
|
+
// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
|
173
|
+
// rules are used to find the type (i.e. first the nested types within this
|
174
|
+
// message are searched, then within the parent, on up to the root
|
175
|
+
// namespace).
|
176
|
+
optional string type_name = 6;
|
177
|
+
|
178
|
+
// For extensions, this is the name of the type being extended. It is
|
179
|
+
// resolved in the same manner as type_name.
|
180
|
+
optional string extendee = 2;
|
181
|
+
|
182
|
+
// For numeric types, contains the original text representation of the value.
|
183
|
+
// For booleans, "true" or "false".
|
184
|
+
// For strings, contains the default text contents (not escaped in any way).
|
185
|
+
// For bytes, contains the C escaped value. All bytes >= 128 are escaped.
|
186
|
+
// TODO(kenton): Base-64 encode?
|
187
|
+
optional string default_value = 7;
|
188
|
+
|
189
|
+
// If set, gives the index of a oneof in the containing type's oneof_decl
|
190
|
+
// list. This field is a member of that oneof.
|
191
|
+
optional int32 oneof_index = 9;
|
192
|
+
|
193
|
+
// JSON name of this field. The value is set by protocol compiler. If the
|
194
|
+
// user has set a "json_name" option on this field, that option's value
|
195
|
+
// will be used. Otherwise, it's deduced from the field's name by converting
|
196
|
+
// it to camelCase.
|
197
|
+
optional string json_name = 10;
|
198
|
+
|
199
|
+
optional FieldOptions options = 8;
|
200
|
+
}
|
201
|
+
|
202
|
+
// Describes a oneof.
|
203
|
+
message OneofDescriptorProto {
|
204
|
+
optional string name = 1;
|
205
|
+
}
|
206
|
+
|
207
|
+
// Describes an enum type.
|
208
|
+
message EnumDescriptorProto {
|
209
|
+
optional string name = 1;
|
210
|
+
|
211
|
+
repeated EnumValueDescriptorProto value = 2;
|
212
|
+
|
213
|
+
optional EnumOptions options = 3;
|
214
|
+
}
|
215
|
+
|
216
|
+
// Describes a value within an enum.
|
217
|
+
message EnumValueDescriptorProto {
|
218
|
+
optional string name = 1;
|
219
|
+
optional int32 number = 2;
|
220
|
+
|
221
|
+
optional EnumValueOptions options = 3;
|
222
|
+
}
|
223
|
+
|
224
|
+
// Describes a service.
|
225
|
+
message ServiceDescriptorProto {
|
226
|
+
optional string name = 1;
|
227
|
+
repeated MethodDescriptorProto method = 2;
|
228
|
+
|
229
|
+
optional ServiceOptions options = 3;
|
230
|
+
}
|
231
|
+
|
232
|
+
// Describes a method of a service.
|
233
|
+
message MethodDescriptorProto {
|
234
|
+
optional string name = 1;
|
235
|
+
|
236
|
+
// Input and output type names. These are resolved in the same way as
|
237
|
+
// FieldDescriptorProto.type_name, but must refer to a message type.
|
238
|
+
optional string input_type = 2;
|
239
|
+
optional string output_type = 3;
|
240
|
+
|
241
|
+
optional MethodOptions options = 4;
|
242
|
+
|
243
|
+
// Identifies if client streams multiple client messages
|
244
|
+
optional bool client_streaming = 5 [default=false];
|
245
|
+
// Identifies if server streams multiple server messages
|
246
|
+
optional bool server_streaming = 6 [default=false];
|
247
|
+
}
|
248
|
+
|
249
|
+
|
250
|
+
// ===================================================================
|
251
|
+
// Options
|
252
|
+
|
253
|
+
// Each of the definitions above may have "options" attached. These are
|
254
|
+
// just annotations which may cause code to be generated slightly differently
|
255
|
+
// or may contain hints for code that manipulates protocol messages.
|
256
|
+
//
|
257
|
+
// Clients may define custom options as extensions of the *Options messages.
|
258
|
+
// These extensions may not yet be known at parsing time, so the parser cannot
|
259
|
+
// store the values in them. Instead it stores them in a field in the *Options
|
260
|
+
// message called uninterpreted_option. This field must have the same name
|
261
|
+
// across all *Options messages. We then use this field to populate the
|
262
|
+
// extensions when we build a descriptor, at which point all protos have been
|
263
|
+
// parsed and so all extensions are known.
|
264
|
+
//
|
265
|
+
// Extension numbers for custom options may be chosen as follows:
|
266
|
+
// * For options which will only be used within a single application or
|
267
|
+
// organization, or for experimental options, use field numbers 50000
|
268
|
+
// through 99999. It is up to you to ensure that you do not use the
|
269
|
+
// same number for multiple options.
|
270
|
+
// * For options which will be published and used publicly by multiple
|
271
|
+
// independent entities, e-mail protobuf-global-extension-registry@google.com
|
272
|
+
// to reserve extension numbers. Simply provide your project name (e.g.
|
273
|
+
// Objective-C plugin) and your project website (if available) -- there's no
|
274
|
+
// need to explain how you intend to use them. Usually you only need one
|
275
|
+
// extension number. You can declare multiple options with only one extension
|
276
|
+
// number by putting them in a sub-message. See the Custom Options section of
|
277
|
+
// the docs for examples:
|
278
|
+
// https://developers.google.com/protocol-buffers/docs/proto#options
|
279
|
+
// If this turns out to be popular, a web service will be set up
|
280
|
+
// to automatically assign option numbers.
|
281
|
+
|
282
|
+
|
283
|
+
message FileOptions {
|
284
|
+
|
285
|
+
// Sets the Java package where classes generated from this .proto will be
|
286
|
+
// placed. By default, the proto package is used, but this is often
|
287
|
+
// inappropriate because proto packages do not normally start with backwards
|
288
|
+
// domain names.
|
289
|
+
optional string java_package = 1;
|
290
|
+
|
291
|
+
|
292
|
+
// If set, all the classes from the .proto file are wrapped in a single
|
293
|
+
// outer class with the given name. This applies to both Proto1
|
294
|
+
// (equivalent to the old "--one_java_file" option) and Proto2 (where
|
295
|
+
// a .proto always translates to a single class, but you may want to
|
296
|
+
// explicitly choose the class name).
|
297
|
+
optional string java_outer_classname = 8;
|
298
|
+
|
299
|
+
// If set true, then the Java code generator will generate a separate .java
|
300
|
+
// file for each top-level message, enum, and service defined in the .proto
|
301
|
+
// file. Thus, these types will *not* be nested inside the outer class
|
302
|
+
// named by java_outer_classname. However, the outer class will still be
|
303
|
+
// generated to contain the file's getDescriptor() method as well as any
|
304
|
+
// top-level extensions defined in the file.
|
305
|
+
optional bool java_multiple_files = 10 [default=false];
|
306
|
+
|
307
|
+
// If set true, then the Java code generator will generate equals() and
|
308
|
+
// hashCode() methods for all messages defined in the .proto file.
|
309
|
+
// This increases generated code size, potentially substantially for large
|
310
|
+
// protos, which may harm a memory-constrained application.
|
311
|
+
// - In the full runtime this is a speed optimization, as the
|
312
|
+
// AbstractMessage base class includes reflection-based implementations of
|
313
|
+
// these methods.
|
314
|
+
// - In the lite runtime, setting this option changes the semantics of
|
315
|
+
// equals() and hashCode() to more closely match those of the full runtime;
|
316
|
+
// the generated methods compute their results based on field values rather
|
317
|
+
// than object identity. (Implementations should not assume that hashcodes
|
318
|
+
// will be consistent across runtimes or versions of the protocol compiler.)
|
319
|
+
optional bool java_generate_equals_and_hash = 20 [default=false];
|
320
|
+
|
321
|
+
// If set true, then the Java2 code generator will generate code that
|
322
|
+
// throws an exception whenever an attempt is made to assign a non-UTF-8
|
323
|
+
// byte sequence to a string field.
|
324
|
+
// Message reflection will do the same.
|
325
|
+
// However, an extension field still accepts non-UTF-8 byte sequences.
|
326
|
+
// This option has no effect on when used with the lite runtime.
|
327
|
+
optional bool java_string_check_utf8 = 27 [default=false];
|
328
|
+
|
329
|
+
|
330
|
+
// Generated classes can be optimized for speed or code size.
|
331
|
+
enum OptimizeMode {
|
332
|
+
SPEED = 1; // Generate complete code for parsing, serialization,
|
333
|
+
// etc.
|
334
|
+
CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
|
335
|
+
LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
|
336
|
+
}
|
337
|
+
optional OptimizeMode optimize_for = 9 [default=SPEED];
|
338
|
+
|
339
|
+
// Sets the Go package where structs generated from this .proto will be
|
340
|
+
// placed. If omitted, the Go package will be derived from the following:
|
341
|
+
// - The basename of the package import path, if provided.
|
342
|
+
// - Otherwise, the package statement in the .proto file, if present.
|
343
|
+
// - Otherwise, the basename of the .proto file, without extension.
|
344
|
+
optional string go_package = 11;
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
// Should generic services be generated in each language? "Generic" services
|
349
|
+
// are not specific to any particular RPC system. They are generated by the
|
350
|
+
// main code generators in each language (without additional plugins).
|
351
|
+
// Generic services were the only kind of service generation supported by
|
352
|
+
// early versions of google.protobuf.
|
353
|
+
//
|
354
|
+
// Generic services are now considered deprecated in favor of using plugins
|
355
|
+
// that generate code specific to your particular RPC system. Therefore,
|
356
|
+
// these default to false. Old code which depends on generic services should
|
357
|
+
// explicitly set them to true.
|
358
|
+
optional bool cc_generic_services = 16 [default=false];
|
359
|
+
optional bool java_generic_services = 17 [default=false];
|
360
|
+
optional bool py_generic_services = 18 [default=false];
|
361
|
+
|
362
|
+
// Is this file deprecated?
|
363
|
+
// Depending on the target platform, this can emit Deprecated annotations
|
364
|
+
// for everything in the file, or it will be completely ignored; in the very
|
365
|
+
// least, this is a formalization for deprecating files.
|
366
|
+
optional bool deprecated = 23 [default=false];
|
367
|
+
|
368
|
+
// Enables the use of arenas for the proto messages in this file. This applies
|
369
|
+
// only to generated classes for C++.
|
370
|
+
optional bool cc_enable_arenas = 31 [default=false];
|
371
|
+
|
372
|
+
|
373
|
+
// Sets the objective c class prefix which is prepended to all objective c
|
374
|
+
// generated classes from this .proto. There is no default.
|
375
|
+
optional string objc_class_prefix = 36;
|
376
|
+
|
377
|
+
// Namespace for generated classes; defaults to the package.
|
378
|
+
optional string csharp_namespace = 37;
|
379
|
+
|
380
|
+
// The parser stores options it doesn't recognize here. See above.
|
381
|
+
repeated UninterpretedOption uninterpreted_option = 999;
|
382
|
+
|
383
|
+
// Clients can define custom options in extensions of this message. See above.
|
384
|
+
extensions 1000 to max;
|
385
|
+
|
386
|
+
reserved 38;
|
387
|
+
}
|
388
|
+
|
389
|
+
message MessageOptions {
|
390
|
+
// Set true to use the old proto1 MessageSet wire format for extensions.
|
391
|
+
// This is provided for backwards-compatibility with the MessageSet wire
|
392
|
+
// format. You should not use this for any other reason: It's less
|
393
|
+
// efficient, has fewer features, and is more complicated.
|
394
|
+
//
|
395
|
+
// The message must be defined exactly as follows:
|
396
|
+
// message Foo {
|
397
|
+
// option message_set_wire_format = true;
|
398
|
+
// extensions 4 to max;
|
399
|
+
// }
|
400
|
+
// Note that the message cannot have any defined fields; MessageSets only
|
401
|
+
// have extensions.
|
402
|
+
//
|
403
|
+
// All extensions of your type must be singular messages; e.g. they cannot
|
404
|
+
// be int32s, enums, or repeated messages.
|
405
|
+
//
|
406
|
+
// Because this is an option, the above two restrictions are not enforced by
|
407
|
+
// the protocol compiler.
|
408
|
+
optional bool message_set_wire_format = 1 [default=false];
|
409
|
+
|
410
|
+
// Disables the generation of the standard "descriptor()" accessor, which can
|
411
|
+
// conflict with a field of the same name. This is meant to make migration
|
412
|
+
// from proto1 easier; new code should avoid fields named "descriptor".
|
413
|
+
optional bool no_standard_descriptor_accessor = 2 [default=false];
|
414
|
+
|
415
|
+
// Is this message deprecated?
|
416
|
+
// Depending on the target platform, this can emit Deprecated annotations
|
417
|
+
// for the message, or it will be completely ignored; in the very least,
|
418
|
+
// this is a formalization for deprecating messages.
|
419
|
+
optional bool deprecated = 3 [default=false];
|
420
|
+
|
421
|
+
// Whether the message is an automatically generated map entry type for the
|
422
|
+
// maps field.
|
423
|
+
//
|
424
|
+
// For maps fields:
|
425
|
+
// map<KeyType, ValueType> map_field = 1;
|
426
|
+
// The parsed descriptor looks like:
|
427
|
+
// message MapFieldEntry {
|
428
|
+
// option map_entry = true;
|
429
|
+
// optional KeyType key = 1;
|
430
|
+
// optional ValueType value = 2;
|
431
|
+
// }
|
432
|
+
// repeated MapFieldEntry map_field = 1;
|
433
|
+
//
|
434
|
+
// Implementations may choose not to generate the map_entry=true message, but
|
435
|
+
// use a native map in the target language to hold the keys and values.
|
436
|
+
// The reflection APIs in such implementions still need to work as
|
437
|
+
// if the field is a repeated message field.
|
438
|
+
//
|
439
|
+
// NOTE: Do not set the option in .proto files. Always use the maps syntax
|
440
|
+
// instead. The option should only be implicitly set by the proto compiler
|
441
|
+
// parser.
|
442
|
+
optional bool map_entry = 7;
|
443
|
+
|
444
|
+
// The parser stores options it doesn't recognize here. See above.
|
445
|
+
repeated UninterpretedOption uninterpreted_option = 999;
|
446
|
+
|
447
|
+
// Clients can define custom options in extensions of this message. See above.
|
448
|
+
extensions 1000 to max;
|
449
|
+
}
|
450
|
+
|
451
|
+
message FieldOptions {
|
452
|
+
// The ctype option instructs the C++ code generator to use a different
|
453
|
+
// representation of the field than it normally would. See the specific
|
454
|
+
// options below. This option is not yet implemented in the open source
|
455
|
+
// release -- sorry, we'll try to include it in a future version!
|
456
|
+
optional CType ctype = 1 [default = STRING];
|
457
|
+
enum CType {
|
458
|
+
// Default mode.
|
459
|
+
STRING = 0;
|
460
|
+
|
461
|
+
CORD = 1;
|
462
|
+
|
463
|
+
STRING_PIECE = 2;
|
464
|
+
}
|
465
|
+
// The packed option can be enabled for repeated primitive fields to enable
|
466
|
+
// a more efficient representation on the wire. Rather than repeatedly
|
467
|
+
// writing the tag and type for each element, the entire array is encoded as
|
468
|
+
// a single length-delimited blob. In proto3, only explicit setting it to
|
469
|
+
// false will avoid using packed encoding.
|
470
|
+
optional bool packed = 2;
|
471
|
+
|
472
|
+
|
473
|
+
// The jstype option determines the JavaScript type used for values of the
|
474
|
+
// field. The option is permitted only for 64 bit integral and fixed types
|
475
|
+
// (int64, uint64, sint64, fixed64, sfixed64). By default these types are
|
476
|
+
// represented as JavaScript strings. This avoids loss of precision that can
|
477
|
+
// happen when a large value is converted to a floating point JavaScript
|
478
|
+
// numbers. Specifying JS_NUMBER for the jstype causes the generated
|
479
|
+
// JavaScript code to use the JavaScript "number" type instead of strings.
|
480
|
+
// This option is an enum to permit additional types to be added,
|
481
|
+
// e.g. goog.math.Integer.
|
482
|
+
optional JSType jstype = 6 [default = JS_NORMAL];
|
483
|
+
enum JSType {
|
484
|
+
// Use the default type.
|
485
|
+
JS_NORMAL = 0;
|
486
|
+
|
487
|
+
// Use JavaScript strings.
|
488
|
+
JS_STRING = 1;
|
489
|
+
|
490
|
+
// Use JavaScript numbers.
|
491
|
+
JS_NUMBER = 2;
|
492
|
+
}
|
493
|
+
|
494
|
+
// Should this field be parsed lazily? Lazy applies only to message-type
|
495
|
+
// fields. It means that when the outer message is initially parsed, the
|
496
|
+
// inner message's contents will not be parsed but instead stored in encoded
|
497
|
+
// form. The inner message will actually be parsed when it is first accessed.
|
498
|
+
//
|
499
|
+
// This is only a hint. Implementations are free to choose whether to use
|
500
|
+
// eager or lazy parsing regardless of the value of this option. However,
|
501
|
+
// setting this option true suggests that the protocol author believes that
|
502
|
+
// using lazy parsing on this field is worth the additional bookkeeping
|
503
|
+
// overhead typically needed to implement it.
|
504
|
+
//
|
505
|
+
// This option does not affect the public interface of any generated code;
|
506
|
+
// all method signatures remain the same. Furthermore, thread-safety of the
|
507
|
+
// interface is not affected by this option; const methods remain safe to
|
508
|
+
// call from multiple threads concurrently, while non-const methods continue
|
509
|
+
// to require exclusive access.
|
510
|
+
//
|
511
|
+
//
|
512
|
+
// Note that implementations may choose not to check required fields within
|
513
|
+
// a lazy sub-message. That is, calling IsInitialized() on the outher message
|
514
|
+
// may return true even if the inner message has missing required fields.
|
515
|
+
// This is necessary because otherwise the inner message would have to be
|
516
|
+
// parsed in order to perform the check, defeating the purpose of lazy
|
517
|
+
// parsing. An implementation which chooses not to check required fields
|
518
|
+
// must be consistent about it. That is, for any particular sub-message, the
|
519
|
+
// implementation must either *always* check its required fields, or *never*
|
520
|
+
// check its required fields, regardless of whether or not the message has
|
521
|
+
// been parsed.
|
522
|
+
optional bool lazy = 5 [default=false];
|
523
|
+
|
524
|
+
// Is this field deprecated?
|
525
|
+
// Depending on the target platform, this can emit Deprecated annotations
|
526
|
+
// for accessors, or it will be completely ignored; in the very least, this
|
527
|
+
// is a formalization for deprecating fields.
|
528
|
+
optional bool deprecated = 3 [default=false];
|
529
|
+
|
530
|
+
// For Google-internal migration only. Do not use.
|
531
|
+
optional bool weak = 10 [default=false];
|
532
|
+
|
533
|
+
|
534
|
+
// The parser stores options it doesn't recognize here. See above.
|
535
|
+
repeated UninterpretedOption uninterpreted_option = 999;
|
536
|
+
|
537
|
+
// Clients can define custom options in extensions of this message. See above.
|
538
|
+
extensions 1000 to max;
|
539
|
+
}
|
540
|
+
|
541
|
+
message EnumOptions {
|
542
|
+
|
543
|
+
// Set this option to true to allow mapping different tag names to the same
|
544
|
+
// value.
|
545
|
+
optional bool allow_alias = 2;
|
546
|
+
|
547
|
+
// Is this enum deprecated?
|
548
|
+
// Depending on the target platform, this can emit Deprecated annotations
|
549
|
+
// for the enum, or it will be completely ignored; in the very least, this
|
550
|
+
// is a formalization for deprecating enums.
|
551
|
+
optional bool deprecated = 3 [default=false];
|
552
|
+
|
553
|
+
// The parser stores options it doesn't recognize here. See above.
|
554
|
+
repeated UninterpretedOption uninterpreted_option = 999;
|
555
|
+
|
556
|
+
// Clients can define custom options in extensions of this message. See above.
|
557
|
+
extensions 1000 to max;
|
558
|
+
}
|
559
|
+
|
560
|
+
message EnumValueOptions {
|
561
|
+
// Is this enum value deprecated?
|
562
|
+
// Depending on the target platform, this can emit Deprecated annotations
|
563
|
+
// for the enum value, or it will be completely ignored; in the very least,
|
564
|
+
// this is a formalization for deprecating enum values.
|
565
|
+
optional bool deprecated = 1 [default=false];
|
566
|
+
|
567
|
+
// The parser stores options it doesn't recognize here. See above.
|
568
|
+
repeated UninterpretedOption uninterpreted_option = 999;
|
569
|
+
|
570
|
+
// Clients can define custom options in extensions of this message. See above.
|
571
|
+
extensions 1000 to max;
|
572
|
+
}
|
573
|
+
|
574
|
+
message ServiceOptions {
|
575
|
+
|
576
|
+
// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
|
577
|
+
// framework. We apologize for hoarding these numbers to ourselves, but
|
578
|
+
// we were already using them long before we decided to release Protocol
|
579
|
+
// Buffers.
|
580
|
+
|
581
|
+
// Is this service deprecated?
|
582
|
+
// Depending on the target platform, this can emit Deprecated annotations
|
583
|
+
// for the service, or it will be completely ignored; in the very least,
|
584
|
+
// this is a formalization for deprecating services.
|
585
|
+
optional bool deprecated = 33 [default=false];
|
586
|
+
|
587
|
+
// The parser stores options it doesn't recognize here. See above.
|
588
|
+
repeated UninterpretedOption uninterpreted_option = 999;
|
589
|
+
|
590
|
+
// Clients can define custom options in extensions of this message. See above.
|
591
|
+
extensions 1000 to max;
|
592
|
+
}
|
593
|
+
|
594
|
+
message MethodOptions {
|
595
|
+
|
596
|
+
// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
|
597
|
+
// framework. We apologize for hoarding these numbers to ourselves, but
|
598
|
+
// we were already using them long before we decided to release Protocol
|
599
|
+
// Buffers.
|
600
|
+
|
601
|
+
// Is this method deprecated?
|
602
|
+
// Depending on the target platform, this can emit Deprecated annotations
|
603
|
+
// for the method, or it will be completely ignored; in the very least,
|
604
|
+
// this is a formalization for deprecating methods.
|
605
|
+
optional bool deprecated = 33 [default=false];
|
606
|
+
|
607
|
+
// The parser stores options it doesn't recognize here. See above.
|
608
|
+
repeated UninterpretedOption uninterpreted_option = 999;
|
609
|
+
|
610
|
+
// Clients can define custom options in extensions of this message. See above.
|
611
|
+
extensions 1000 to max;
|
612
|
+
}
|
613
|
+
|
614
|
+
|
615
|
+
// A message representing a option the parser does not recognize. This only
|
616
|
+
// appears in options protos created by the compiler::Parser class.
|
617
|
+
// DescriptorPool resolves these when building Descriptor objects. Therefore,
|
618
|
+
// options protos in descriptor objects (e.g. returned by Descriptor::options(),
|
619
|
+
// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
|
620
|
+
// in them.
|
621
|
+
message UninterpretedOption {
|
622
|
+
// The name of the uninterpreted option. Each string represents a segment in
|
623
|
+
// a dot-separated name. is_extension is true iff a segment represents an
|
624
|
+
// extension (denoted with parentheses in options specs in .proto files).
|
625
|
+
// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
|
626
|
+
// "foo.(bar.baz).qux".
|
627
|
+
message NamePart {
|
628
|
+
required string name_part = 1;
|
629
|
+
required bool is_extension = 2;
|
630
|
+
}
|
631
|
+
repeated NamePart name = 2;
|
632
|
+
|
633
|
+
// The value of the uninterpreted option, in whatever type the tokenizer
|
634
|
+
// identified it as during parsing. Exactly one of these should be set.
|
635
|
+
optional string identifier_value = 3;
|
636
|
+
optional uint64 positive_int_value = 4;
|
637
|
+
optional int64 negative_int_value = 5;
|
638
|
+
optional double double_value = 6;
|
639
|
+
optional bytes string_value = 7;
|
640
|
+
optional string aggregate_value = 8;
|
641
|
+
}
|
642
|
+
|
643
|
+
// ===================================================================
|
644
|
+
// Optional source code info
|
645
|
+
|
646
|
+
// Encapsulates information about the original source file from which a
|
647
|
+
// FileDescriptorProto was generated.
|
648
|
+
message SourceCodeInfo {
|
649
|
+
// A Location identifies a piece of source code in a .proto file which
|
650
|
+
// corresponds to a particular definition. This information is intended
|
651
|
+
// to be useful to IDEs, code indexers, documentation generators, and similar
|
652
|
+
// tools.
|
653
|
+
//
|
654
|
+
// For example, say we have a file like:
|
655
|
+
// message Foo {
|
656
|
+
// optional string foo = 1;
|
657
|
+
// }
|
658
|
+
// Let's look at just the field definition:
|
659
|
+
// optional string foo = 1;
|
660
|
+
// ^ ^^ ^^ ^ ^^^
|
661
|
+
// a bc de f ghi
|
662
|
+
// We have the following locations:
|
663
|
+
// span path represents
|
664
|
+
// [a,i) [ 4, 0, 2, 0 ] The whole field definition.
|
665
|
+
// [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
|
666
|
+
// [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
|
667
|
+
// [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
|
668
|
+
// [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
|
669
|
+
//
|
670
|
+
// Notes:
|
671
|
+
// - A location may refer to a repeated field itself (i.e. not to any
|
672
|
+
// particular index within it). This is used whenever a set of elements are
|
673
|
+
// logically enclosed in a single code segment. For example, an entire
|
674
|
+
// extend block (possibly containing multiple extension definitions) will
|
675
|
+
// have an outer location whose path refers to the "extensions" repeated
|
676
|
+
// field without an index.
|
677
|
+
// - Multiple locations may have the same path. This happens when a single
|
678
|
+
// logical declaration is spread out across multiple places. The most
|
679
|
+
// obvious example is the "extend" block again -- there may be multiple
|
680
|
+
// extend blocks in the same scope, each of which will have the same path.
|
681
|
+
// - A location's span is not always a subset of its parent's span. For
|
682
|
+
// example, the "extendee" of an extension declaration appears at the
|
683
|
+
// beginning of the "extend" block and is shared by all extensions within
|
684
|
+
// the block.
|
685
|
+
// - Just because a location's span is a subset of some other location's span
|
686
|
+
// does not mean that it is a descendent. For example, a "group" defines
|
687
|
+
// both a type and a field in a single declaration. Thus, the locations
|
688
|
+
// corresponding to the type and field and their components will overlap.
|
689
|
+
// - Code which tries to interpret locations should probably be designed to
|
690
|
+
// ignore those that it doesn't understand, as more types of locations could
|
691
|
+
// be recorded in the future.
|
692
|
+
repeated Location location = 1;
|
693
|
+
message Location {
|
694
|
+
// Identifies which part of the FileDescriptorProto was defined at this
|
695
|
+
// location.
|
696
|
+
//
|
697
|
+
// Each element is a field number or an index. They form a path from
|
698
|
+
// the root FileDescriptorProto to the place where the definition. For
|
699
|
+
// example, this path:
|
700
|
+
// [ 4, 3, 2, 7, 1 ]
|
701
|
+
// refers to:
|
702
|
+
// file.message_type(3) // 4, 3
|
703
|
+
// .field(7) // 2, 7
|
704
|
+
// .name() // 1
|
705
|
+
// This is because FileDescriptorProto.message_type has field number 4:
|
706
|
+
// repeated DescriptorProto message_type = 4;
|
707
|
+
// and DescriptorProto.field has field number 2:
|
708
|
+
// repeated FieldDescriptorProto field = 2;
|
709
|
+
// and FieldDescriptorProto.name has field number 1:
|
710
|
+
// optional string name = 1;
|
711
|
+
//
|
712
|
+
// Thus, the above path gives the location of a field name. If we removed
|
713
|
+
// the last element:
|
714
|
+
// [ 4, 3, 2, 7 ]
|
715
|
+
// this path refers to the whole field declaration (from the beginning
|
716
|
+
// of the label to the terminating semicolon).
|
717
|
+
repeated int32 path = 1 [packed=true];
|
718
|
+
|
719
|
+
// Always has exactly three or four elements: start line, start column,
|
720
|
+
// end line (optional, otherwise assumed same as start line), end column.
|
721
|
+
// These are packed into a single field for efficiency. Note that line
|
722
|
+
// and column numbers are zero-based -- typically you will want to add
|
723
|
+
// 1 to each before displaying to a user.
|
724
|
+
repeated int32 span = 2 [packed=true];
|
725
|
+
|
726
|
+
// If this SourceCodeInfo represents a complete declaration, these are any
|
727
|
+
// comments appearing before and after the declaration which appear to be
|
728
|
+
// attached to the declaration.
|
729
|
+
//
|
730
|
+
// A series of line comments appearing on consecutive lines, with no other
|
731
|
+
// tokens appearing on those lines, will be treated as a single comment.
|
732
|
+
//
|
733
|
+
// leading_detached_comments will keep paragraphs of comments that appear
|
734
|
+
// before (but not connected to) the current element. Each paragraph,
|
735
|
+
// separated by empty lines, will be one comment element in the repeated
|
736
|
+
// field.
|
737
|
+
//
|
738
|
+
// Only the comment content is provided; comment markers (e.g. //) are
|
739
|
+
// stripped out. For block comments, leading whitespace and an asterisk
|
740
|
+
// will be stripped from the beginning of each line other than the first.
|
741
|
+
// Newlines are included in the output.
|
742
|
+
//
|
743
|
+
// Examples:
|
744
|
+
//
|
745
|
+
// optional int32 foo = 1; // Comment attached to foo.
|
746
|
+
// // Comment attached to bar.
|
747
|
+
// optional int32 bar = 2;
|
748
|
+
//
|
749
|
+
// optional string baz = 3;
|
750
|
+
// // Comment attached to baz.
|
751
|
+
// // Another line attached to baz.
|
752
|
+
//
|
753
|
+
// // Comment attached to qux.
|
754
|
+
// //
|
755
|
+
// // Another line attached to qux.
|
756
|
+
// optional double qux = 4;
|
757
|
+
//
|
758
|
+
// // Detached comment for corge. This is not leading or trailing comments
|
759
|
+
// // to qux or corge because there are blank lines separating it from
|
760
|
+
// // both.
|
761
|
+
//
|
762
|
+
// // Detached comment for corge paragraph 2.
|
763
|
+
//
|
764
|
+
// optional string corge = 5;
|
765
|
+
// /* Block comment attached
|
766
|
+
// * to corge. Leading asterisks
|
767
|
+
// * will be removed. */
|
768
|
+
// /* Block comment attached to
|
769
|
+
// * grault. */
|
770
|
+
// optional int32 grault = 6;
|
771
|
+
//
|
772
|
+
// // ignored detached comments.
|
773
|
+
optional string leading_comments = 3;
|
774
|
+
optional string trailing_comments = 4;
|
775
|
+
repeated string leading_detached_comments = 6;
|
776
|
+
}
|
777
|
+
}
|
778
|
+
|
779
|
+
// Describes the relationship between generated code and its original source
|
780
|
+
// file. A GeneratedCodeInfo message is associated with only one generated
|
781
|
+
// source file, but may contain references to different source .proto files.
|
782
|
+
message GeneratedCodeInfo {
|
783
|
+
// An Annotation connects some span of text in generated code to an element
|
784
|
+
// of its generating .proto file.
|
785
|
+
repeated Annotation annotation = 1;
|
786
|
+
message Annotation {
|
787
|
+
// Identifies the element in the original source .proto file. This field
|
788
|
+
// is formatted the same as SourceCodeInfo.Location.path.
|
789
|
+
repeated int32 path = 1 [packed=true];
|
790
|
+
|
791
|
+
// Identifies the filesystem path to the original source .proto.
|
792
|
+
optional string source_file = 2;
|
793
|
+
|
794
|
+
// Identifies the starting offset in bytes in the generated code
|
795
|
+
// that relates to the identified object.
|
796
|
+
optional int32 begin = 3;
|
797
|
+
|
798
|
+
// Identifies the ending offset in bytes in the generated code that
|
799
|
+
// relates to the identified offset. The end offset should be one past
|
800
|
+
// the last relevant byte (so the length of the text = end - begin).
|
801
|
+
optional int32 end = 4;
|
802
|
+
}
|
803
|
+
}
|