grpc 1.30.2-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/etc/roots.pem +4644 -0
- data/grpc_c.32.ruby +0 -0
- data/grpc_c.64.ruby +0 -0
- data/src/ruby/bin/math_client.rb +140 -0
- data/src/ruby/bin/math_pb.rb +34 -0
- data/src/ruby/bin/math_server.rb +191 -0
- data/src/ruby/bin/math_services_pb.rb +51 -0
- data/src/ruby/bin/noproto_client.rb +93 -0
- data/src/ruby/bin/noproto_server.rb +97 -0
- data/src/ruby/ext/grpc/ext-export.clang +1 -0
- data/src/ruby/ext/grpc/ext-export.gcc +6 -0
- data/src/ruby/ext/grpc/extconf.rb +107 -0
- data/src/ruby/ext/grpc/rb_byte_buffer.c +64 -0
- data/src/ruby/ext/grpc/rb_byte_buffer.h +35 -0
- data/src/ruby/ext/grpc/rb_call.c +1050 -0
- data/src/ruby/ext/grpc/rb_call.h +53 -0
- data/src/ruby/ext/grpc/rb_call_credentials.c +297 -0
- data/src/ruby/ext/grpc/rb_call_credentials.h +31 -0
- data/src/ruby/ext/grpc/rb_channel.c +835 -0
- data/src/ruby/ext/grpc/rb_channel.h +34 -0
- data/src/ruby/ext/grpc/rb_channel_args.c +155 -0
- data/src/ruby/ext/grpc/rb_channel_args.h +38 -0
- data/src/ruby/ext/grpc/rb_channel_credentials.c +267 -0
- data/src/ruby/ext/grpc/rb_channel_credentials.h +32 -0
- data/src/ruby/ext/grpc/rb_completion_queue.c +100 -0
- data/src/ruby/ext/grpc/rb_completion_queue.h +36 -0
- data/src/ruby/ext/grpc/rb_compression_options.c +470 -0
- data/src/ruby/ext/grpc/rb_compression_options.h +29 -0
- data/src/ruby/ext/grpc/rb_enable_cpp.cc +22 -0
- data/src/ruby/ext/grpc/rb_event_thread.c +143 -0
- data/src/ruby/ext/grpc/rb_event_thread.h +21 -0
- data/src/ruby/ext/grpc/rb_grpc.c +328 -0
- data/src/ruby/ext/grpc/rb_grpc.h +76 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +573 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +865 -0
- data/src/ruby/ext/grpc/rb_loader.c +57 -0
- data/src/ruby/ext/grpc/rb_loader.h +25 -0
- data/src/ruby/ext/grpc/rb_server.c +372 -0
- data/src/ruby/ext/grpc/rb_server.h +32 -0
- data/src/ruby/ext/grpc/rb_server_credentials.c +243 -0
- data/src/ruby/ext/grpc/rb_server_credentials.h +32 -0
- data/src/ruby/lib/grpc.rb +37 -0
- data/src/ruby/lib/grpc/2.3/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.4/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.5/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.6/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.7/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/core/status_codes.rb +135 -0
- data/src/ruby/lib/grpc/core/time_consts.rb +56 -0
- data/src/ruby/lib/grpc/errors.rb +277 -0
- data/src/ruby/lib/grpc/generic/active_call.rb +669 -0
- data/src/ruby/lib/grpc/generic/bidi_call.rb +233 -0
- data/src/ruby/lib/grpc/generic/client_stub.rb +501 -0
- data/src/ruby/lib/grpc/generic/interceptor_registry.rb +53 -0
- data/src/ruby/lib/grpc/generic/interceptors.rb +186 -0
- data/src/ruby/lib/grpc/generic/rpc_desc.rb +204 -0
- data/src/ruby/lib/grpc/generic/rpc_server.rb +551 -0
- data/src/ruby/lib/grpc/generic/service.rb +211 -0
- data/src/ruby/lib/grpc/google_rpc_status_utils.rb +40 -0
- data/src/ruby/lib/grpc/grpc.rb +24 -0
- data/src/ruby/lib/grpc/logconfig.rb +44 -0
- data/src/ruby/lib/grpc/notifier.rb +45 -0
- data/src/ruby/lib/grpc/structs.rb +15 -0
- data/src/ruby/lib/grpc/version.rb +18 -0
- data/src/ruby/pb/README.md +42 -0
- data/src/ruby/pb/generate_proto_ruby.sh +51 -0
- data/src/ruby/pb/grpc/health/checker.rb +75 -0
- data/src/ruby/pb/grpc/health/v1/health_pb.rb +31 -0
- data/src/ruby/pb/grpc/health/v1/health_services_pb.rb +62 -0
- data/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services_pb.rb +44 -0
- data/src/ruby/pb/grpc/testing/metrics_pb.rb +28 -0
- data/src/ruby/pb/grpc/testing/metrics_services_pb.rb +49 -0
- data/src/ruby/pb/src/proto/grpc/testing/empty_pb.rb +17 -0
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +105 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +16 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb +118 -0
- data/src/ruby/pb/test/client.rb +769 -0
- data/src/ruby/pb/test/server.rb +252 -0
- data/src/ruby/pb/test/xds_client.rb +213 -0
- data/src/ruby/spec/call_credentials_spec.rb +42 -0
- data/src/ruby/spec/call_spec.rb +180 -0
- data/src/ruby/spec/channel_connection_spec.rb +126 -0
- data/src/ruby/spec/channel_credentials_spec.rb +82 -0
- data/src/ruby/spec/channel_spec.rb +234 -0
- data/src/ruby/spec/client_auth_spec.rb +126 -0
- data/src/ruby/spec/client_server_spec.rb +664 -0
- data/src/ruby/spec/compression_options_spec.rb +149 -0
- data/src/ruby/spec/debug_message_spec.rb +134 -0
- data/src/ruby/spec/error_sanity_spec.rb +49 -0
- data/src/ruby/spec/errors_spec.rb +142 -0
- data/src/ruby/spec/generic/active_call_spec.rb +672 -0
- data/src/ruby/spec/generic/client_interceptors_spec.rb +153 -0
- data/src/ruby/spec/generic/client_stub_spec.rb +1083 -0
- data/src/ruby/spec/generic/interceptor_registry_spec.rb +65 -0
- data/src/ruby/spec/generic/rpc_desc_spec.rb +374 -0
- data/src/ruby/spec/generic/rpc_server_pool_spec.rb +127 -0
- data/src/ruby/spec/generic/rpc_server_spec.rb +748 -0
- data/src/ruby/spec/generic/server_interceptors_spec.rb +218 -0
- data/src/ruby/spec/generic/service_spec.rb +263 -0
- data/src/ruby/spec/google_rpc_status_utils_spec.rb +282 -0
- data/src/ruby/spec/pb/codegen/grpc/testing/package_options.proto +28 -0
- data/src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto +22 -0
- data/src/ruby/spec/pb/codegen/grpc/testing/package_options_import2.proto +23 -0
- data/src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto +41 -0
- data/src/ruby/spec/pb/codegen/package_option_spec.rb +82 -0
- data/src/ruby/spec/pb/duplicate/codegen_spec.rb +57 -0
- data/src/ruby/spec/pb/health/checker_spec.rb +236 -0
- data/src/ruby/spec/server_credentials_spec.rb +79 -0
- data/src/ruby/spec/server_spec.rb +209 -0
- data/src/ruby/spec/spec_helper.rb +61 -0
- data/src/ruby/spec/support/helpers.rb +107 -0
- data/src/ruby/spec/support/services.rb +160 -0
- data/src/ruby/spec/testdata/README +1 -0
- data/src/ruby/spec/testdata/ca.pem +20 -0
- data/src/ruby/spec/testdata/client.key +28 -0
- data/src/ruby/spec/testdata/client.pem +20 -0
- data/src/ruby/spec/testdata/server1.key +28 -0
- data/src/ruby/spec/testdata/server1.pem +22 -0
- data/src/ruby/spec/time_consts_spec.rb +74 -0
- metadata +394 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# Copyright 2015 gRPC authors.
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
# Regenerates gRPC service stubs from proto files.
|
17
|
+
set -e
|
18
|
+
cd $(dirname $0)/../../..
|
19
|
+
|
20
|
+
# protoc and grpc_*_plugin binaries can be obtained by running
|
21
|
+
# $ bazel build @com_google_protobuf//:protoc //src/compiler:all
|
22
|
+
PROTOC=bazel-bin/external/com_google_protobuf/protoc
|
23
|
+
PLUGIN=protoc-gen-grpc=bazel-bin/src/compiler/grpc_ruby_plugin
|
24
|
+
|
25
|
+
$PROTOC -I src/proto src/proto/grpc/health/v1/health.proto \
|
26
|
+
--grpc_out=src/ruby/pb \
|
27
|
+
--ruby_out=src/ruby/pb \
|
28
|
+
--plugin=$PLUGIN
|
29
|
+
|
30
|
+
$PROTOC -I . \
|
31
|
+
src/proto/grpc/testing/{messages,test,empty}.proto \
|
32
|
+
--grpc_out=src/ruby/pb \
|
33
|
+
--ruby_out=src/ruby/pb \
|
34
|
+
--plugin=$PLUGIN
|
35
|
+
|
36
|
+
$PROTOC -I . \
|
37
|
+
src/proto/grpc/core/stats.proto \
|
38
|
+
--grpc_out=src/ruby/qps \
|
39
|
+
--ruby_out=src/ruby/qps \
|
40
|
+
--plugin=$PLUGIN
|
41
|
+
|
42
|
+
$PROTOC -I . \
|
43
|
+
src/proto/grpc/testing/{messages,payloads,stats,benchmark_service,report_qps_scenario_service,worker_service,control}.proto \
|
44
|
+
--grpc_out=src/ruby/qps \
|
45
|
+
--ruby_out=src/ruby/qps \
|
46
|
+
--plugin=$PLUGIN
|
47
|
+
|
48
|
+
$PROTOC -I src/proto/math src/proto/math/math.proto \
|
49
|
+
--grpc_out=src/ruby/bin \
|
50
|
+
--ruby_out=src/ruby/bin \
|
51
|
+
--plugin=$PLUGIN
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# Copyright 2015 gRPC authors.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'grpc'
|
16
|
+
require 'grpc/health/v1/health_services_pb'
|
17
|
+
|
18
|
+
module Grpc
|
19
|
+
# Health contains classes and modules that support providing a health check
|
20
|
+
# service.
|
21
|
+
module Health
|
22
|
+
# Checker is implementation of the schema-specified health checking service.
|
23
|
+
class Checker < V1::Health::Service
|
24
|
+
StatusCodes = GRPC::Core::StatusCodes
|
25
|
+
HealthCheckResponse = V1::HealthCheckResponse
|
26
|
+
|
27
|
+
# Initializes the statuses of participating services
|
28
|
+
def initialize
|
29
|
+
@statuses = {}
|
30
|
+
@status_mutex = Mutex.new # guards access to @statuses
|
31
|
+
end
|
32
|
+
|
33
|
+
# Implements the rpc IDL API method
|
34
|
+
def check(req, _call)
|
35
|
+
status = nil
|
36
|
+
@status_mutex.synchronize do
|
37
|
+
status = @statuses["#{req.service}"]
|
38
|
+
end
|
39
|
+
if status.nil?
|
40
|
+
fail GRPC::BadStatus.new_status_exception(StatusCodes::NOT_FOUND)
|
41
|
+
end
|
42
|
+
HealthCheckResponse.new(status: status)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Adds the health status for a given service.
|
46
|
+
def add_status(service, status)
|
47
|
+
@status_mutex.synchronize { @statuses["#{service}"] = status }
|
48
|
+
end
|
49
|
+
|
50
|
+
# Adds given health status for all given services
|
51
|
+
def set_status_for_services(status, *services)
|
52
|
+
@status_mutex.synchronize do
|
53
|
+
services.each { |service| @statuses["#{service}"] = status }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Adds health status for each service given within hash
|
58
|
+
def add_statuses(service_statuses = {})
|
59
|
+
@status_mutex.synchronize do
|
60
|
+
service_statuses.each_pair { |service, status| @statuses["#{service}"] = status }
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Clears the status for the given service.
|
65
|
+
def clear_status(service)
|
66
|
+
@status_mutex.synchronize { @statuses.delete("#{service}") }
|
67
|
+
end
|
68
|
+
|
69
|
+
# Clears alls the statuses.
|
70
|
+
def clear_all
|
71
|
+
@status_mutex.synchronize { @statuses = {} }
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: grpc/health/v1/health.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_file("grpc/health/v1/health.proto", :syntax => :proto3) do
|
8
|
+
add_message "grpc.health.v1.HealthCheckRequest" do
|
9
|
+
optional :service, :string, 1
|
10
|
+
end
|
11
|
+
add_message "grpc.health.v1.HealthCheckResponse" do
|
12
|
+
optional :status, :enum, 1, "grpc.health.v1.HealthCheckResponse.ServingStatus"
|
13
|
+
end
|
14
|
+
add_enum "grpc.health.v1.HealthCheckResponse.ServingStatus" do
|
15
|
+
value :UNKNOWN, 0
|
16
|
+
value :SERVING, 1
|
17
|
+
value :NOT_SERVING, 2
|
18
|
+
value :SERVICE_UNKNOWN, 3
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
module Grpc
|
24
|
+
module Health
|
25
|
+
module V1
|
26
|
+
HealthCheckRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckRequest").msgclass
|
27
|
+
HealthCheckResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse").msgclass
|
28
|
+
HealthCheckResponse::ServingStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse.ServingStatus").enummodule
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: grpc/health/v1/health.proto for package 'grpc.health.v1'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2015 The gRPC Authors
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
# The canonical version of this proto can be found at
|
19
|
+
# https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'grpc'
|
23
|
+
require 'grpc/health/v1/health_pb'
|
24
|
+
|
25
|
+
module Grpc
|
26
|
+
module Health
|
27
|
+
module V1
|
28
|
+
module Health
|
29
|
+
class Service
|
30
|
+
|
31
|
+
include GRPC::GenericService
|
32
|
+
|
33
|
+
self.marshal_class_method = :encode
|
34
|
+
self.unmarshal_class_method = :decode
|
35
|
+
self.service_name = 'grpc.health.v1.Health'
|
36
|
+
|
37
|
+
# If the requested service is unknown, the call will fail with status
|
38
|
+
# NOT_FOUND.
|
39
|
+
rpc :Check, HealthCheckRequest, HealthCheckResponse
|
40
|
+
# Performs a watch for the serving status of the requested service.
|
41
|
+
# The server will immediately send back a message indicating the current
|
42
|
+
# serving status. It will then subsequently send a new message whenever
|
43
|
+
# the service's serving status changes.
|
44
|
+
#
|
45
|
+
# If the requested service is unknown when the call is received, the
|
46
|
+
# server will send a message setting the serving status to
|
47
|
+
# SERVICE_UNKNOWN but will *not* terminate the call. If at some
|
48
|
+
# future point, the serving status of the service becomes known, the
|
49
|
+
# server will send a new message with the service's serving status.
|
50
|
+
#
|
51
|
+
# If the call terminates with status UNIMPLEMENTED, then clients
|
52
|
+
# should assume this method is not supported and should not retry the
|
53
|
+
# call. If the call terminates with any other status (including OK),
|
54
|
+
# clients should retry the call with appropriate exponential backoff.
|
55
|
+
rpc :Watch, HealthCheckRequest, stream(HealthCheckResponse)
|
56
|
+
end
|
57
|
+
|
58
|
+
Stub = Service.rpc_stub_class
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: src/proto/grpc/testing/duplicate/echo_duplicate.proto for package 'grpc.testing.duplicate'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2015 gRPC authors.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
# This is a partial copy of echo.proto with a different package name.
|
19
|
+
#
|
20
|
+
|
21
|
+
require 'grpc'
|
22
|
+
require 'src/proto/grpc/testing/duplicate/echo_duplicate_pb'
|
23
|
+
|
24
|
+
module Grpc
|
25
|
+
module Testing
|
26
|
+
module Duplicate
|
27
|
+
module EchoTestService
|
28
|
+
class Service
|
29
|
+
|
30
|
+
include GRPC::GenericService
|
31
|
+
|
32
|
+
self.marshal_class_method = :encode
|
33
|
+
self.unmarshal_class_method = :decode
|
34
|
+
self.service_name = 'grpc.testing.duplicate.EchoTestService'
|
35
|
+
|
36
|
+
rpc :Echo, Grpc::Testing::EchoRequest, Grpc::Testing::EchoResponse
|
37
|
+
rpc :ResponseStream, Grpc::Testing::EchoRequest, stream(Grpc::Testing::EchoResponse)
|
38
|
+
end
|
39
|
+
|
40
|
+
Stub = Service.rpc_stub_class
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: src/proto/grpc/testing/metrics.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_message "grpc.testing.GaugeResponse" do
|
8
|
+
optional :name, :string, 1
|
9
|
+
oneof :value do
|
10
|
+
optional :long_value, :int64, 2
|
11
|
+
optional :double_value, :double, 3
|
12
|
+
optional :string_value, :string, 4
|
13
|
+
end
|
14
|
+
end
|
15
|
+
add_message "grpc.testing.GaugeRequest" do
|
16
|
+
optional :name, :string, 1
|
17
|
+
end
|
18
|
+
add_message "grpc.testing.EmptyMessage" do
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
module Grpc
|
23
|
+
module Testing
|
24
|
+
GaugeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GaugeResponse").msgclass
|
25
|
+
GaugeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GaugeRequest").msgclass
|
26
|
+
EmptyMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EmptyMessage").msgclass
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: src/proto/grpc/testing/metrics.proto for package 'grpc.testing'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2015-2016 gRPC authors.
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
# Contains the definitions for a metrics service and the type of metrics
|
19
|
+
# exposed by the service.
|
20
|
+
#
|
21
|
+
# Currently, 'Gauge' (i.e a metric that represents the measured value of
|
22
|
+
# something at an instant of time) is the only metric type supported by the
|
23
|
+
# service.
|
24
|
+
|
25
|
+
require 'grpc'
|
26
|
+
require 'src/proto/grpc/testing/metrics_pb'
|
27
|
+
|
28
|
+
module Grpc
|
29
|
+
module Testing
|
30
|
+
module MetricsService
|
31
|
+
class Service
|
32
|
+
|
33
|
+
include GRPC::GenericService
|
34
|
+
|
35
|
+
self.marshal_class_method = :encode
|
36
|
+
self.unmarshal_class_method = :decode
|
37
|
+
self.service_name = 'grpc.testing.MetricsService'
|
38
|
+
|
39
|
+
# Returns the values of all the gauges that are currently being maintained by
|
40
|
+
# the service
|
41
|
+
rpc :GetAllGauges, EmptyMessage, stream(GaugeResponse)
|
42
|
+
# Returns the value of one gauge
|
43
|
+
rpc :GetGauge, GaugeRequest, GaugeResponse
|
44
|
+
end
|
45
|
+
|
46
|
+
Stub = Service.rpc_stub_class
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: src/proto/grpc/testing/empty.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_file("src/proto/grpc/testing/empty.proto", :syntax => :proto3) do
|
8
|
+
add_message "grpc.testing.Empty" do
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
module Grpc
|
14
|
+
module Testing
|
15
|
+
Empty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Empty").msgclass
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: src/proto/grpc/testing/messages.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_file("src/proto/grpc/testing/messages.proto", :syntax => :proto3) do
|
8
|
+
add_message "grpc.testing.BoolValue" do
|
9
|
+
optional :value, :bool, 1
|
10
|
+
end
|
11
|
+
add_message "grpc.testing.Payload" do
|
12
|
+
optional :type, :enum, 1, "grpc.testing.PayloadType"
|
13
|
+
optional :body, :bytes, 2
|
14
|
+
end
|
15
|
+
add_message "grpc.testing.EchoStatus" do
|
16
|
+
optional :code, :int32, 1
|
17
|
+
optional :message, :string, 2
|
18
|
+
end
|
19
|
+
add_message "grpc.testing.SimpleRequest" do
|
20
|
+
optional :response_type, :enum, 1, "grpc.testing.PayloadType"
|
21
|
+
optional :response_size, :int32, 2
|
22
|
+
optional :payload, :message, 3, "grpc.testing.Payload"
|
23
|
+
optional :fill_username, :bool, 4
|
24
|
+
optional :fill_oauth_scope, :bool, 5
|
25
|
+
optional :response_compressed, :message, 6, "grpc.testing.BoolValue"
|
26
|
+
optional :response_status, :message, 7, "grpc.testing.EchoStatus"
|
27
|
+
optional :expect_compressed, :message, 8, "grpc.testing.BoolValue"
|
28
|
+
optional :fill_server_id, :bool, 9
|
29
|
+
optional :fill_grpclb_route_type, :bool, 10
|
30
|
+
end
|
31
|
+
add_message "grpc.testing.SimpleResponse" do
|
32
|
+
optional :payload, :message, 1, "grpc.testing.Payload"
|
33
|
+
optional :username, :string, 2
|
34
|
+
optional :oauth_scope, :string, 3
|
35
|
+
optional :server_id, :string, 4
|
36
|
+
optional :grpclb_route_type, :enum, 5, "grpc.testing.GrpclbRouteType"
|
37
|
+
optional :hostname, :string, 6
|
38
|
+
end
|
39
|
+
add_message "grpc.testing.StreamingInputCallRequest" do
|
40
|
+
optional :payload, :message, 1, "grpc.testing.Payload"
|
41
|
+
optional :expect_compressed, :message, 2, "grpc.testing.BoolValue"
|
42
|
+
end
|
43
|
+
add_message "grpc.testing.StreamingInputCallResponse" do
|
44
|
+
optional :aggregated_payload_size, :int32, 1
|
45
|
+
end
|
46
|
+
add_message "grpc.testing.ResponseParameters" do
|
47
|
+
optional :size, :int32, 1
|
48
|
+
optional :interval_us, :int32, 2
|
49
|
+
optional :compressed, :message, 3, "grpc.testing.BoolValue"
|
50
|
+
end
|
51
|
+
add_message "grpc.testing.StreamingOutputCallRequest" do
|
52
|
+
optional :response_type, :enum, 1, "grpc.testing.PayloadType"
|
53
|
+
repeated :response_parameters, :message, 2, "grpc.testing.ResponseParameters"
|
54
|
+
optional :payload, :message, 3, "grpc.testing.Payload"
|
55
|
+
optional :response_status, :message, 7, "grpc.testing.EchoStatus"
|
56
|
+
end
|
57
|
+
add_message "grpc.testing.StreamingOutputCallResponse" do
|
58
|
+
optional :payload, :message, 1, "grpc.testing.Payload"
|
59
|
+
end
|
60
|
+
add_message "grpc.testing.ReconnectParams" do
|
61
|
+
optional :max_reconnect_backoff_ms, :int32, 1
|
62
|
+
end
|
63
|
+
add_message "grpc.testing.ReconnectInfo" do
|
64
|
+
optional :passed, :bool, 1
|
65
|
+
repeated :backoff_ms, :int32, 2
|
66
|
+
end
|
67
|
+
add_message "grpc.testing.LoadBalancerStatsRequest" do
|
68
|
+
optional :num_rpcs, :int32, 1
|
69
|
+
optional :timeout_sec, :int32, 2
|
70
|
+
end
|
71
|
+
add_message "grpc.testing.LoadBalancerStatsResponse" do
|
72
|
+
map :rpcs_by_peer, :string, :int32, 1
|
73
|
+
optional :num_failures, :int32, 2
|
74
|
+
end
|
75
|
+
add_enum "grpc.testing.PayloadType" do
|
76
|
+
value :COMPRESSABLE, 0
|
77
|
+
end
|
78
|
+
add_enum "grpc.testing.GrpclbRouteType" do
|
79
|
+
value :GRPCLB_ROUTE_TYPE_UNKNOWN, 0
|
80
|
+
value :GRPCLB_ROUTE_TYPE_FALLBACK, 1
|
81
|
+
value :GRPCLB_ROUTE_TYPE_BACKEND, 2
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
module Grpc
|
87
|
+
module Testing
|
88
|
+
BoolValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.BoolValue").msgclass
|
89
|
+
Payload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Payload").msgclass
|
90
|
+
EchoStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EchoStatus").msgclass
|
91
|
+
SimpleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleRequest").msgclass
|
92
|
+
SimpleResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleResponse").msgclass
|
93
|
+
StreamingInputCallRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallRequest").msgclass
|
94
|
+
StreamingInputCallResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallResponse").msgclass
|
95
|
+
ResponseParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ResponseParameters").msgclass
|
96
|
+
StreamingOutputCallRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallRequest").msgclass
|
97
|
+
StreamingOutputCallResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallResponse").msgclass
|
98
|
+
ReconnectParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectParams").msgclass
|
99
|
+
ReconnectInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass
|
100
|
+
LoadBalancerStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsRequest").msgclass
|
101
|
+
LoadBalancerStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse").msgclass
|
102
|
+
PayloadType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
|
103
|
+
GrpclbRouteType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GrpclbRouteType").enummodule
|
104
|
+
end
|
105
|
+
end
|