protobuffy 3.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +21 -0
- data/.travis.yml +12 -0
- data/.yardopts +5 -0
- data/CHANGES.md +261 -0
- data/CONTRIBUTING.md +16 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +14 -0
- data/README.md +58 -0
- data/Rakefile +61 -0
- data/bin/protoc-gen-ruby +17 -0
- data/bin/rpc_server +4 -0
- data/examples/bin/reverse-client-http +4 -0
- data/examples/bin/reverse-client-socket +4 -0
- data/examples/bin/reverse-client-zmq +4 -0
- data/examples/config.ru +6 -0
- data/examples/definitions/example/reverse.proto +12 -0
- data/examples/lib/example/reverse-client.rb +23 -0
- data/examples/lib/example/reverse-service.rb +9 -0
- data/examples/lib/example/reverse.pb.rb +36 -0
- data/lib/protobuf.rb +106 -0
- data/lib/protobuf/cli.rb +249 -0
- data/lib/protobuf/code_generator.rb +41 -0
- data/lib/protobuf/decoder.rb +74 -0
- data/lib/protobuf/deprecator.rb +42 -0
- data/lib/protobuf/descriptors.rb +3 -0
- data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +52 -0
- data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +249 -0
- data/lib/protobuf/encoder.rb +62 -0
- data/lib/protobuf/enum.rb +319 -0
- data/lib/protobuf/exceptions.rb +9 -0
- data/lib/protobuf/field.rb +74 -0
- data/lib/protobuf/field/base_field.rb +280 -0
- data/lib/protobuf/field/bool_field.rb +53 -0
- data/lib/protobuf/field/bytes_field.rb +81 -0
- data/lib/protobuf/field/double_field.rb +26 -0
- data/lib/protobuf/field/enum_field.rb +57 -0
- data/lib/protobuf/field/field_array.rb +86 -0
- data/lib/protobuf/field/fixed32_field.rb +25 -0
- data/lib/protobuf/field/fixed64_field.rb +29 -0
- data/lib/protobuf/field/float_field.rb +38 -0
- data/lib/protobuf/field/int32_field.rb +22 -0
- data/lib/protobuf/field/int64_field.rb +22 -0
- data/lib/protobuf/field/integer_field.rb +24 -0
- data/lib/protobuf/field/message_field.rb +66 -0
- data/lib/protobuf/field/sfixed32_field.rb +28 -0
- data/lib/protobuf/field/sfixed64_field.rb +29 -0
- data/lib/protobuf/field/signed_integer_field.rb +30 -0
- data/lib/protobuf/field/sint32_field.rb +22 -0
- data/lib/protobuf/field/sint64_field.rb +22 -0
- data/lib/protobuf/field/string_field.rb +35 -0
- data/lib/protobuf/field/uint32_field.rb +22 -0
- data/lib/protobuf/field/uint64_field.rb +22 -0
- data/lib/protobuf/field/varint_field.rb +68 -0
- data/lib/protobuf/generators/base.rb +71 -0
- data/lib/protobuf/generators/enum_generator.rb +42 -0
- data/lib/protobuf/generators/extension_generator.rb +28 -0
- data/lib/protobuf/generators/field_generator.rb +132 -0
- data/lib/protobuf/generators/file_generator.rb +140 -0
- data/lib/protobuf/generators/group_generator.rb +113 -0
- data/lib/protobuf/generators/message_generator.rb +99 -0
- data/lib/protobuf/generators/printable.rb +161 -0
- data/lib/protobuf/generators/service_generator.rb +27 -0
- data/lib/protobuf/http.rb +20 -0
- data/lib/protobuf/lifecycle.rb +46 -0
- data/lib/protobuf/logger.rb +86 -0
- data/lib/protobuf/message.rb +182 -0
- data/lib/protobuf/message/fields.rb +122 -0
- data/lib/protobuf/message/serialization.rb +84 -0
- data/lib/protobuf/optionable.rb +23 -0
- data/lib/protobuf/rpc/buffer.rb +79 -0
- data/lib/protobuf/rpc/client.rb +168 -0
- data/lib/protobuf/rpc/connector.rb +21 -0
- data/lib/protobuf/rpc/connectors/base.rb +54 -0
- data/lib/protobuf/rpc/connectors/common.rb +172 -0
- data/lib/protobuf/rpc/connectors/http.rb +90 -0
- data/lib/protobuf/rpc/connectors/socket.rb +73 -0
- data/lib/protobuf/rpc/connectors/zmq.rb +205 -0
- data/lib/protobuf/rpc/dynamic_discovery.pb.rb +47 -0
- data/lib/protobuf/rpc/env.rb +58 -0
- data/lib/protobuf/rpc/error.rb +28 -0
- data/lib/protobuf/rpc/error/client_error.rb +31 -0
- data/lib/protobuf/rpc/error/server_error.rb +43 -0
- data/lib/protobuf/rpc/middleware.rb +25 -0
- data/lib/protobuf/rpc/middleware/exception_handler.rb +36 -0
- data/lib/protobuf/rpc/middleware/logger.rb +91 -0
- data/lib/protobuf/rpc/middleware/request_decoder.rb +83 -0
- data/lib/protobuf/rpc/middleware/response_encoder.rb +88 -0
- data/lib/protobuf/rpc/middleware/runner.rb +18 -0
- data/lib/protobuf/rpc/rpc.pb.rb +53 -0
- data/lib/protobuf/rpc/server.rb +39 -0
- data/lib/protobuf/rpc/servers/http/server.rb +101 -0
- data/lib/protobuf/rpc/servers/http_runner.rb +34 -0
- data/lib/protobuf/rpc/servers/socket/server.rb +113 -0
- data/lib/protobuf/rpc/servers/socket/worker.rb +56 -0
- data/lib/protobuf/rpc/servers/socket_runner.rb +34 -0
- data/lib/protobuf/rpc/servers/zmq/broker.rb +155 -0
- data/lib/protobuf/rpc/servers/zmq/server.rb +313 -0
- data/lib/protobuf/rpc/servers/zmq/util.rb +47 -0
- data/lib/protobuf/rpc/servers/zmq/worker.rb +105 -0
- data/lib/protobuf/rpc/servers/zmq_runner.rb +51 -0
- data/lib/protobuf/rpc/service.rb +179 -0
- data/lib/protobuf/rpc/service_directory.rb +245 -0
- data/lib/protobuf/rpc/service_dispatcher.rb +46 -0
- data/lib/protobuf/rpc/service_filters.rb +273 -0
- data/lib/protobuf/rpc/stat.rb +148 -0
- data/lib/protobuf/socket.rb +22 -0
- data/lib/protobuf/tasks.rb +1 -0
- data/lib/protobuf/tasks/compile.rake +61 -0
- data/lib/protobuf/version.rb +3 -0
- data/lib/protobuf/wire_type.rb +10 -0
- data/lib/protobuf/zmq.rb +21 -0
- data/proto/dynamic_discovery.proto +44 -0
- data/proto/google/protobuf/compiler/plugin.proto +147 -0
- data/proto/google/protobuf/descriptor.proto +620 -0
- data/proto/rpc.proto +62 -0
- data/protobuffy.gemspec +37 -0
- data/spec/benchmark/tasks.rb +113 -0
- data/spec/bin/protoc-gen-ruby_spec.rb +18 -0
- data/spec/data/data.bin +3 -0
- data/spec/data/types.bin +0 -0
- data/spec/encoding/all_types_spec.rb +91 -0
- data/spec/encoding/extreme_values_spec.rb +0 -0
- data/spec/functional/socket_server_spec.rb +59 -0
- data/spec/functional/zmq_server_spec.rb +103 -0
- data/spec/lib/protobuf/cli_spec.rb +267 -0
- data/spec/lib/protobuf/code_generator_spec.rb +60 -0
- data/spec/lib/protobuf/enum_spec.rb +239 -0
- data/spec/lib/protobuf/field/int32_field_spec.rb +7 -0
- data/spec/lib/protobuf/field/string_field_spec.rb +46 -0
- data/spec/lib/protobuf/field_spec.rb +194 -0
- data/spec/lib/protobuf/generators/base_spec.rb +87 -0
- data/spec/lib/protobuf/generators/enum_generator_spec.rb +68 -0
- data/spec/lib/protobuf/generators/extension_generator_spec.rb +43 -0
- data/spec/lib/protobuf/generators/field_generator_spec.rb +99 -0
- data/spec/lib/protobuf/generators/file_generator_spec.rb +29 -0
- data/spec/lib/protobuf/generators/message_generator_spec.rb +0 -0
- data/spec/lib/protobuf/generators/service_generator_spec.rb +43 -0
- data/spec/lib/protobuf/lifecycle_spec.rb +89 -0
- data/spec/lib/protobuf/logger_spec.rb +136 -0
- data/spec/lib/protobuf/message_spec.rb +368 -0
- data/spec/lib/protobuf/optionable_spec.rb +46 -0
- data/spec/lib/protobuf/rpc/client_spec.rb +66 -0
- data/spec/lib/protobuf/rpc/connector_spec.rb +26 -0
- data/spec/lib/protobuf/rpc/connectors/base_spec.rb +50 -0
- data/spec/lib/protobuf/rpc/connectors/common_spec.rb +170 -0
- data/spec/lib/protobuf/rpc/connectors/connector_spec.rb +13 -0
- data/spec/lib/protobuf/rpc/connectors/http_spec.rb +61 -0
- data/spec/lib/protobuf/rpc/connectors/socket_spec.rb +24 -0
- data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +129 -0
- data/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb +62 -0
- data/spec/lib/protobuf/rpc/middleware/logger_spec.rb +49 -0
- data/spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb +115 -0
- data/spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb +75 -0
- data/spec/lib/protobuf/rpc/servers/http/server_spec.rb +104 -0
- data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +38 -0
- data/spec/lib/protobuf/rpc/servers/zmq/server_spec.rb +41 -0
- data/spec/lib/protobuf/rpc/servers/zmq/util_spec.rb +55 -0
- data/spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb +35 -0
- data/spec/lib/protobuf/rpc/service_directory_spec.rb +295 -0
- data/spec/lib/protobuf/rpc/service_dispatcher_spec.rb +52 -0
- data/spec/lib/protobuf/rpc/service_filters_spec.rb +484 -0
- data/spec/lib/protobuf/rpc/service_spec.rb +161 -0
- data/spec/lib/protobuf/rpc/stat_spec.rb +151 -0
- data/spec/lib/protobuf_spec.rb +78 -0
- data/spec/spec_helper.rb +57 -0
- data/spec/support/all.rb +7 -0
- data/spec/support/packed_field.rb +22 -0
- data/spec/support/server.rb +94 -0
- data/spec/support/test/all_types.data.bin +0 -0
- data/spec/support/test/all_types.data.txt +119 -0
- data/spec/support/test/defaults.pb.rb +25 -0
- data/spec/support/test/defaults.proto +9 -0
- data/spec/support/test/enum.pb.rb +59 -0
- data/spec/support/test/enum.proto +34 -0
- data/spec/support/test/extended.pb.rb +22 -0
- data/spec/support/test/extended.proto +10 -0
- data/spec/support/test/extreme_values.data.bin +0 -0
- data/spec/support/test/google_unittest.pb.rb +543 -0
- data/spec/support/test/google_unittest.proto +713 -0
- data/spec/support/test/google_unittest_import.pb.rb +37 -0
- data/spec/support/test/google_unittest_import.proto +64 -0
- data/spec/support/test/google_unittest_import_public.pb.rb +8 -0
- data/spec/support/test/google_unittest_import_public.proto +38 -0
- data/spec/support/test/multi_field_extensions.pb.rb +56 -0
- data/spec/support/test/multi_field_extensions.proto +33 -0
- data/spec/support/test/resource.pb.rb +117 -0
- data/spec/support/test/resource.proto +94 -0
- data/spec/support/test/resource_service.rb +26 -0
- data/spec/support/test_app_file.rb +2 -0
- data/spec/support/tolerance_matcher.rb +40 -0
- metadata +367 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'protobuf/generators/file_generator'
|
2
|
+
|
3
|
+
module Protobuf
|
4
|
+
class CodeGenerator
|
5
|
+
|
6
|
+
CodeGeneratorFatalError = Class.new(RuntimeError)
|
7
|
+
|
8
|
+
def self.fatal(message)
|
9
|
+
raise CodeGeneratorFatalError, message
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.print_tag_warning_suppress
|
13
|
+
STDERR.puts "Suppress tag warning output with PB_NO_TAG_WARNINGS=1."
|
14
|
+
def self.print_tag_warning_suppress; end
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.warn(message)
|
18
|
+
STDERR.puts("[WARN] #{message}")
|
19
|
+
end
|
20
|
+
|
21
|
+
def initialize(request_bytes)
|
22
|
+
@request = ::Google::Protobuf::Compiler::CodeGeneratorRequest.decode(request_bytes)
|
23
|
+
@generated_files = []
|
24
|
+
end
|
25
|
+
|
26
|
+
def generate_file(file_descriptor)
|
27
|
+
file_generator = ::Protobuf::Generators::FileGenerator.new(file_descriptor)
|
28
|
+
@generated_files << file_generator.generate_output_file
|
29
|
+
end
|
30
|
+
|
31
|
+
def response_bytes
|
32
|
+
@request.proto_file.each do |file_descriptor|
|
33
|
+
generate_file(file_descriptor)
|
34
|
+
end
|
35
|
+
|
36
|
+
return ::Google::Protobuf::Compiler::CodeGeneratorResponse.encode(:file => @generated_files)
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'protobuf/wire_type'
|
2
|
+
require 'protobuf/exceptions'
|
3
|
+
|
4
|
+
module Protobuf
|
5
|
+
class Decoder
|
6
|
+
|
7
|
+
# Read bytes from +stream+ and pass to +message+ object.
|
8
|
+
def self.decode_each_field(stream, &block)
|
9
|
+
until stream.eof?
|
10
|
+
tag, bytes = read_field(stream)
|
11
|
+
block.call(tag, bytes)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.read_field(stream)
|
16
|
+
tag, wire_type = read_key(stream)
|
17
|
+
bytes = case wire_type
|
18
|
+
when ::Protobuf::WireType::VARINT then
|
19
|
+
read_varint(stream)
|
20
|
+
when ::Protobuf::WireType::FIXED64 then
|
21
|
+
read_fixed64(stream)
|
22
|
+
when ::Protobuf::WireType::LENGTH_DELIMITED then
|
23
|
+
read_length_delimited(stream)
|
24
|
+
when ::Protobuf::WireType::FIXED32 then
|
25
|
+
read_fixed32(stream)
|
26
|
+
when ::Protobuf::WireType::START_GROUP then
|
27
|
+
raise NotImplementedError, 'Group is deprecated.'
|
28
|
+
when ::Protobuf::WireType::END_GROUP then
|
29
|
+
raise NotImplementedError, 'Group is deprecated.'
|
30
|
+
else
|
31
|
+
raise InvalidWireType, wire_type
|
32
|
+
end
|
33
|
+
|
34
|
+
return tag, bytes
|
35
|
+
end
|
36
|
+
|
37
|
+
# Read 32-bit string value from +stream+.
|
38
|
+
def self.read_fixed32(stream)
|
39
|
+
stream.read(4)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Read 64-bit string value from +stream+.
|
43
|
+
def self.read_fixed64(stream)
|
44
|
+
stream.read(8)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Read key pair (tag and wire-type) from +stream+.
|
48
|
+
def self.read_key(stream)
|
49
|
+
bits = read_varint(stream)
|
50
|
+
wire_type = bits & 0x07
|
51
|
+
tag = bits >> 3
|
52
|
+
[tag, wire_type]
|
53
|
+
end
|
54
|
+
|
55
|
+
# Read length-delimited string value from +stream+.
|
56
|
+
def self.read_length_delimited(stream)
|
57
|
+
value_length = read_varint(stream)
|
58
|
+
stream.read(value_length)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Read varint integer value from +stream+.
|
62
|
+
def self.read_varint(stream)
|
63
|
+
value = index = 0
|
64
|
+
begin
|
65
|
+
byte = stream.readbyte
|
66
|
+
value |= (byte & 0x7f) << (7 * index)
|
67
|
+
index += 1
|
68
|
+
end while (byte & 0x80).nonzero?
|
69
|
+
value
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Protobuf
|
2
|
+
module Deprecator
|
3
|
+
|
4
|
+
def warn_deprecated(old_method, new_method)
|
5
|
+
$stderr.puts %Q{[DEPRECATED] #{self.name}.#{old_method} is deprecated and will disappear in a future version.
|
6
|
+
Please use #{self.name}.#{new_method} instead.\n}
|
7
|
+
end
|
8
|
+
|
9
|
+
# Given deprecations should be a hash whose keys are the new methods
|
10
|
+
# and values are a list of deprecated methods that should send to t
|
11
|
+
def deprecate_method(old_method, new_method)
|
12
|
+
class_eval(<<-DEPRECATED, __FILE__, __LINE__ + 1)
|
13
|
+
def #{old_method}(*args)
|
14
|
+
warn_deprecated("#{old_method}", "#{new_method}")
|
15
|
+
new_meth = method("#{new_method}")
|
16
|
+
if new_meth.arity == 0
|
17
|
+
__send__("#{new_method}")
|
18
|
+
else
|
19
|
+
__send__("#{new_method}", *args)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
DEPRECATED
|
23
|
+
end
|
24
|
+
|
25
|
+
# Given deprecations should be a hash whose keys are the new methods
|
26
|
+
# and values are a list of deprecated methods that should send to t
|
27
|
+
def deprecate_class_method(old_method, new_method)
|
28
|
+
class_eval(<<-DEPRECATED, __FILE__, __LINE__ + 1)
|
29
|
+
def self.#{old_method}(*args)
|
30
|
+
warn_deprecated("#{old_method}", "#{new_method}")
|
31
|
+
new_meth = method("#{new_method}")
|
32
|
+
if new_meth.arity == 0
|
33
|
+
__send__("#{new_method}")
|
34
|
+
else
|
35
|
+
__send__("#{new_method}", *args)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
DEPRECATED
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
##
|
2
|
+
# This file is auto-generated. DO NOT EDIT!
|
3
|
+
#
|
4
|
+
require 'protobuf/message'
|
5
|
+
|
6
|
+
|
7
|
+
##
|
8
|
+
# Imports
|
9
|
+
#
|
10
|
+
require 'google/protobuf/descriptor.pb'
|
11
|
+
|
12
|
+
module Google
|
13
|
+
module Protobuf
|
14
|
+
module Compiler
|
15
|
+
|
16
|
+
##
|
17
|
+
# Message Classes
|
18
|
+
#
|
19
|
+
class CodeGeneratorRequest < ::Protobuf::Message; end
|
20
|
+
class CodeGeneratorResponse < ::Protobuf::Message
|
21
|
+
class File < ::Protobuf::Message; end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
##
|
28
|
+
# Message Fields
|
29
|
+
#
|
30
|
+
class CodeGeneratorRequest
|
31
|
+
repeated :string, :file_to_generate, 1
|
32
|
+
optional :string, :parameter, 2
|
33
|
+
repeated ::Google::Protobuf::FileDescriptorProto, :proto_file, 15
|
34
|
+
end
|
35
|
+
|
36
|
+
class CodeGeneratorResponse
|
37
|
+
class File
|
38
|
+
optional :string, :name, 1
|
39
|
+
optional :string, :insertion_point, 2
|
40
|
+
optional :string, :content, 15
|
41
|
+
end
|
42
|
+
|
43
|
+
optional :string, :error, 1
|
44
|
+
repeated ::Google::Protobuf::Compiler::CodeGeneratorResponse::File, :file, 15
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
@@ -0,0 +1,249 @@
|
|
1
|
+
##
|
2
|
+
# This file is auto-generated. DO NOT EDIT!
|
3
|
+
#
|
4
|
+
require 'protobuf/message'
|
5
|
+
|
6
|
+
module Google
|
7
|
+
module Protobuf
|
8
|
+
|
9
|
+
##
|
10
|
+
# Message Classes
|
11
|
+
#
|
12
|
+
class FileDescriptorSet < ::Protobuf::Message; end
|
13
|
+
class FileDescriptorProto < ::Protobuf::Message; end
|
14
|
+
class DescriptorProto < ::Protobuf::Message
|
15
|
+
class ExtensionRange < ::Protobuf::Message; end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
class FieldDescriptorProto < ::Protobuf::Message
|
20
|
+
class Type < ::Protobuf::Enum
|
21
|
+
define :TYPE_DOUBLE, 1
|
22
|
+
define :TYPE_FLOAT, 2
|
23
|
+
define :TYPE_INT64, 3
|
24
|
+
define :TYPE_UINT64, 4
|
25
|
+
define :TYPE_INT32, 5
|
26
|
+
define :TYPE_FIXED64, 6
|
27
|
+
define :TYPE_FIXED32, 7
|
28
|
+
define :TYPE_BOOL, 8
|
29
|
+
define :TYPE_STRING, 9
|
30
|
+
define :TYPE_GROUP, 10
|
31
|
+
define :TYPE_MESSAGE, 11
|
32
|
+
define :TYPE_BYTES, 12
|
33
|
+
define :TYPE_UINT32, 13
|
34
|
+
define :TYPE_ENUM, 14
|
35
|
+
define :TYPE_SFIXED32, 15
|
36
|
+
define :TYPE_SFIXED64, 16
|
37
|
+
define :TYPE_SINT32, 17
|
38
|
+
define :TYPE_SINT64, 18
|
39
|
+
end
|
40
|
+
|
41
|
+
class Label < ::Protobuf::Enum
|
42
|
+
define :LABEL_OPTIONAL, 1
|
43
|
+
define :LABEL_REQUIRED, 2
|
44
|
+
define :LABEL_REPEATED, 3
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
class EnumDescriptorProto < ::Protobuf::Message; end
|
50
|
+
class EnumValueDescriptorProto < ::Protobuf::Message; end
|
51
|
+
class ServiceDescriptorProto < ::Protobuf::Message; end
|
52
|
+
class MethodDescriptorProto < ::Protobuf::Message; end
|
53
|
+
class FileOptions < ::Protobuf::Message
|
54
|
+
class OptimizeMode < ::Protobuf::Enum
|
55
|
+
define :SPEED, 1
|
56
|
+
define :CODE_SIZE, 2
|
57
|
+
define :LITE_RUNTIME, 3
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
class MessageOptions < ::Protobuf::Message; end
|
63
|
+
class FieldOptions < ::Protobuf::Message
|
64
|
+
class CType < ::Protobuf::Enum
|
65
|
+
define :STRING, 0
|
66
|
+
define :CORD, 1
|
67
|
+
define :STRING_PIECE, 2
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
class EnumOptions < ::Protobuf::Message; end
|
73
|
+
class EnumValueOptions < ::Protobuf::Message; end
|
74
|
+
class ServiceOptions < ::Protobuf::Message; end
|
75
|
+
class MethodOptions < ::Protobuf::Message; end
|
76
|
+
class UninterpretedOption < ::Protobuf::Message
|
77
|
+
class NamePart < ::Protobuf::Message; end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
class SourceCodeInfo < ::Protobuf::Message
|
82
|
+
class Location < ::Protobuf::Message; end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
##
|
89
|
+
# Message Fields
|
90
|
+
#
|
91
|
+
class FileDescriptorSet
|
92
|
+
repeated ::Google::Protobuf::FileDescriptorProto, :file, 1
|
93
|
+
end
|
94
|
+
|
95
|
+
class FileDescriptorProto
|
96
|
+
optional :string, :name, 1
|
97
|
+
optional :string, :package, 2
|
98
|
+
repeated :string, :dependency, 3
|
99
|
+
repeated :int32, :public_dependency, 10
|
100
|
+
repeated :int32, :weak_dependency, 11
|
101
|
+
repeated ::Google::Protobuf::DescriptorProto, :message_type, 4
|
102
|
+
repeated ::Google::Protobuf::EnumDescriptorProto, :enum_type, 5
|
103
|
+
repeated ::Google::Protobuf::ServiceDescriptorProto, :service, 6
|
104
|
+
repeated ::Google::Protobuf::FieldDescriptorProto, :extension, 7
|
105
|
+
optional ::Google::Protobuf::FileOptions, :options, 8
|
106
|
+
optional ::Google::Protobuf::SourceCodeInfo, :source_code_info, 9
|
107
|
+
end
|
108
|
+
|
109
|
+
class DescriptorProto
|
110
|
+
class ExtensionRange
|
111
|
+
optional :int32, :start, 1
|
112
|
+
optional :int32, :end, 2
|
113
|
+
end
|
114
|
+
|
115
|
+
optional :string, :name, 1
|
116
|
+
repeated ::Google::Protobuf::FieldDescriptorProto, :field, 2
|
117
|
+
repeated ::Google::Protobuf::FieldDescriptorProto, :extension, 6
|
118
|
+
repeated ::Google::Protobuf::DescriptorProto, :nested_type, 3
|
119
|
+
repeated ::Google::Protobuf::EnumDescriptorProto, :enum_type, 4
|
120
|
+
repeated ::Google::Protobuf::DescriptorProto::ExtensionRange, :extension_range, 5
|
121
|
+
optional ::Google::Protobuf::MessageOptions, :options, 7
|
122
|
+
end
|
123
|
+
|
124
|
+
class FieldDescriptorProto
|
125
|
+
optional :string, :name, 1
|
126
|
+
optional :int32, :number, 3
|
127
|
+
optional ::Google::Protobuf::FieldDescriptorProto::Label, :label, 4
|
128
|
+
optional ::Google::Protobuf::FieldDescriptorProto::Type, :type, 5
|
129
|
+
optional :string, :type_name, 6
|
130
|
+
optional :string, :extendee, 2
|
131
|
+
optional :string, :default_value, 7
|
132
|
+
optional ::Google::Protobuf::FieldOptions, :options, 8
|
133
|
+
end
|
134
|
+
|
135
|
+
class EnumDescriptorProto
|
136
|
+
optional :string, :name, 1
|
137
|
+
repeated ::Google::Protobuf::EnumValueDescriptorProto, :value, 2
|
138
|
+
optional ::Google::Protobuf::EnumOptions, :options, 3
|
139
|
+
end
|
140
|
+
|
141
|
+
class EnumValueDescriptorProto
|
142
|
+
optional :string, :name, 1
|
143
|
+
optional :int32, :number, 2
|
144
|
+
optional ::Google::Protobuf::EnumValueOptions, :options, 3
|
145
|
+
end
|
146
|
+
|
147
|
+
class ServiceDescriptorProto
|
148
|
+
optional :string, :name, 1
|
149
|
+
repeated ::Google::Protobuf::MethodDescriptorProto, :method, 2
|
150
|
+
optional ::Google::Protobuf::ServiceOptions, :options, 3
|
151
|
+
end
|
152
|
+
|
153
|
+
class MethodDescriptorProto
|
154
|
+
optional :string, :name, 1
|
155
|
+
optional :string, :input_type, 2
|
156
|
+
optional :string, :output_type, 3
|
157
|
+
optional ::Google::Protobuf::MethodOptions, :options, 4
|
158
|
+
end
|
159
|
+
|
160
|
+
class FileOptions
|
161
|
+
optional :string, :java_package, 1
|
162
|
+
optional :string, :java_outer_classname, 8
|
163
|
+
optional :bool, :java_multiple_files, 10, :default => false
|
164
|
+
optional :bool, :java_generate_equals_and_hash, 20, :default => false
|
165
|
+
optional ::Google::Protobuf::FileOptions::OptimizeMode, :optimize_for, 9, :default => ::Google::Protobuf::FileOptions::OptimizeMode::SPEED
|
166
|
+
optional :string, :go_package, 11
|
167
|
+
optional :bool, :cc_generic_services, 16, :default => false
|
168
|
+
optional :bool, :java_generic_services, 17, :default => false
|
169
|
+
optional :bool, :py_generic_services, 18, :default => false
|
170
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
171
|
+
# Extension Fields
|
172
|
+
extensions 1000...536870912
|
173
|
+
end
|
174
|
+
|
175
|
+
class MessageOptions
|
176
|
+
optional :bool, :message_set_wire_format, 1, :default => false
|
177
|
+
optional :bool, :no_standard_descriptor_accessor, 2, :default => false
|
178
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
179
|
+
# Extension Fields
|
180
|
+
extensions 1000...536870912
|
181
|
+
end
|
182
|
+
|
183
|
+
class FieldOptions
|
184
|
+
optional ::Google::Protobuf::FieldOptions::CType, :ctype, 1, :default => ::Google::Protobuf::FieldOptions::CType::STRING
|
185
|
+
optional :bool, :packed, 2
|
186
|
+
optional :bool, :lazy, 5, :default => false
|
187
|
+
optional :bool, :deprecated, 3, :default => false
|
188
|
+
optional :string, :experimental_map_key, 9
|
189
|
+
optional :bool, :weak, 10, :default => false
|
190
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
191
|
+
# Extension Fields
|
192
|
+
extensions 1000...536870912
|
193
|
+
end
|
194
|
+
|
195
|
+
class EnumOptions
|
196
|
+
optional :bool, :allow_alias, 2, :default => true
|
197
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
198
|
+
# Extension Fields
|
199
|
+
extensions 1000...536870912
|
200
|
+
end
|
201
|
+
|
202
|
+
class EnumValueOptions
|
203
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
204
|
+
# Extension Fields
|
205
|
+
extensions 1000...536870912
|
206
|
+
end
|
207
|
+
|
208
|
+
class ServiceOptions
|
209
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
210
|
+
# Extension Fields
|
211
|
+
extensions 1000...536870912
|
212
|
+
end
|
213
|
+
|
214
|
+
class MethodOptions
|
215
|
+
repeated ::Google::Protobuf::UninterpretedOption, :uninterpreted_option, 999
|
216
|
+
# Extension Fields
|
217
|
+
extensions 1000...536870912
|
218
|
+
end
|
219
|
+
|
220
|
+
class UninterpretedOption
|
221
|
+
class NamePart
|
222
|
+
required :string, :name_part, 1
|
223
|
+
required :bool, :is_extension, 2
|
224
|
+
end
|
225
|
+
|
226
|
+
repeated ::Google::Protobuf::UninterpretedOption::NamePart, :name, 2
|
227
|
+
optional :string, :identifier_value, 3
|
228
|
+
optional :uint64, :positive_int_value, 4
|
229
|
+
optional :int64, :negative_int_value, 5
|
230
|
+
optional :double, :double_value, 6
|
231
|
+
optional :bytes, :string_value, 7
|
232
|
+
optional :string, :aggregate_value, 8
|
233
|
+
end
|
234
|
+
|
235
|
+
class SourceCodeInfo
|
236
|
+
class Location
|
237
|
+
repeated :int32, :path, 1, :packed => true
|
238
|
+
repeated :int32, :span, 2, :packed => true
|
239
|
+
optional :string, :leading_comments, 3
|
240
|
+
optional :string, :trailing_comments, 4
|
241
|
+
end
|
242
|
+
|
243
|
+
repeated ::Google::Protobuf::SourceCodeInfo::Location, :location, 1
|
244
|
+
end
|
245
|
+
|
246
|
+
end
|
247
|
+
|
248
|
+
end
|
249
|
+
|