grpc 0.13.0.pre1.1-universal-darwin
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 +5114 -0
- data/grpc_c.32.ruby +0 -0
- data/grpc_c.64.ruby +0 -0
- data/src/ruby/bin/apis/google/protobuf/empty.rb +44 -0
- data/src/ruby/bin/apis/pubsub_demo.rb +256 -0
- data/src/ruby/bin/apis/tech/pubsub/proto/pubsub.rb +174 -0
- data/src/ruby/bin/apis/tech/pubsub/proto/pubsub_services.rb +103 -0
- data/src/ruby/bin/grpc_ruby_interop_client +33 -0
- data/src/ruby/bin/grpc_ruby_interop_server +33 -0
- data/src/ruby/bin/interop/interop_client.rb +51 -0
- data/src/ruby/bin/interop/interop_server.rb +50 -0
- data/src/ruby/bin/math.rb +32 -0
- data/src/ruby/bin/math_client.rb +147 -0
- data/src/ruby/bin/math_server.rb +206 -0
- data/src/ruby/bin/math_services.rb +27 -0
- data/src/ruby/bin/noproto_client.rb +108 -0
- data/src/ruby/bin/noproto_server.rb +112 -0
- data/src/ruby/ext/grpc/extconf.rb +129 -0
- data/src/ruby/ext/grpc/rb_byte_buffer.c +70 -0
- data/src/ruby/ext/grpc/rb_byte_buffer.h +47 -0
- data/src/ruby/ext/grpc/rb_call.c +908 -0
- data/src/ruby/ext/grpc/rb_call.h +66 -0
- data/src/ruby/ext/grpc/rb_call_credentials.c +319 -0
- data/src/ruby/ext/grpc/rb_call_credentials.h +46 -0
- data/src/ruby/ext/grpc/rb_channel.c +432 -0
- data/src/ruby/ext/grpc/rb_channel.h +47 -0
- data/src/ruby/ext/grpc/rb_channel_args.c +169 -0
- data/src/ruby/ext/grpc/rb_channel_args.h +53 -0
- data/src/ruby/ext/grpc/rb_channel_credentials.c +268 -0
- data/src/ruby/ext/grpc/rb_channel_credentials.h +47 -0
- data/src/ruby/ext/grpc/rb_completion_queue.c +183 -0
- data/src/ruby/ext/grpc/rb_completion_queue.h +55 -0
- data/src/ruby/ext/grpc/rb_event_thread.c +158 -0
- data/src/ruby/ext/grpc/rb_event_thread.h +37 -0
- data/src/ruby/ext/grpc/rb_grpc.c +336 -0
- data/src/ruby/ext/grpc/rb_grpc.h +85 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +560 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +843 -0
- data/src/ruby/ext/grpc/rb_loader.c +72 -0
- data/src/ruby/ext/grpc/rb_loader.h +40 -0
- data/src/ruby/ext/grpc/rb_server.c +400 -0
- data/src/ruby/ext/grpc/rb_server.h +47 -0
- data/src/ruby/ext/grpc/rb_server_credentials.c +284 -0
- data/src/ruby/ext/grpc/rb_server_credentials.h +47 -0
- data/src/ruby/lib/grpc.rb +44 -0
- data/src/ruby/lib/grpc/2.0/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/2.1/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/2.2/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/2.3/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/core/time_consts.rb +71 -0
- data/src/ruby/lib/grpc/errors.rb +62 -0
- data/src/ruby/lib/grpc/generic/active_call.rb +488 -0
- data/src/ruby/lib/grpc/generic/bidi_call.rb +218 -0
- data/src/ruby/lib/grpc/generic/client_stub.rb +471 -0
- data/src/ruby/lib/grpc/generic/rpc_desc.rb +147 -0
- data/src/ruby/lib/grpc/generic/rpc_server.rb +504 -0
- data/src/ruby/lib/grpc/generic/service.rb +234 -0
- data/src/ruby/lib/grpc/grpc.rb +34 -0
- data/src/ruby/lib/grpc/logconfig.rb +59 -0
- data/src/ruby/lib/grpc/notifier.rb +60 -0
- data/src/ruby/lib/grpc/version.rb +33 -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/v1alpha/health.rb +29 -0
- data/src/ruby/pb/grpc/health/v1alpha/health_services.rb +28 -0
- data/src/ruby/pb/test/client.rb +469 -0
- data/src/ruby/pb/test/proto/empty.rb +15 -0
- data/src/ruby/pb/test/proto/messages.rb +80 -0
- data/src/ruby/pb/test/proto/test.rb +14 -0
- data/src/ruby/pb/test/proto/test_services.rb +64 -0
- data/src/ruby/pb/test/server.rb +253 -0
- data/src/ruby/spec/call_credentials_spec.rb +57 -0
- data/src/ruby/spec/call_spec.rb +163 -0
- data/src/ruby/spec/channel_credentials_spec.rb +97 -0
- data/src/ruby/spec/channel_spec.rb +177 -0
- data/src/ruby/spec/client_server_spec.rb +475 -0
- data/src/ruby/spec/completion_queue_spec.rb +42 -0
- data/src/ruby/spec/generic/active_call_spec.rb +373 -0
- data/src/ruby/spec/generic/client_stub_spec.rb +476 -0
- data/src/ruby/spec/generic/rpc_desc_spec.rb +331 -0
- data/src/ruby/spec/generic/rpc_server_pool_spec.rb +138 -0
- data/src/ruby/spec/generic/rpc_server_spec.rb +576 -0
- data/src/ruby/spec/generic/service_spec.rb +345 -0
- data/src/ruby/spec/pb/health/checker_spec.rb +232 -0
- data/src/ruby/spec/server_credentials_spec.rb +94 -0
- data/src/ruby/spec/server_spec.rb +209 -0
- data/src/ruby/spec/spec_helper.rb +69 -0
- data/src/ruby/spec/testdata/README +1 -0
- data/src/ruby/spec/testdata/ca.pem +15 -0
- data/src/ruby/spec/testdata/server1.key +16 -0
- data/src/ruby/spec/testdata/server1.pem +16 -0
- data/src/ruby/spec/time_consts_spec.rb +89 -0
- metadata +319 -0
data/grpc_c.32.ruby
ADDED
File without changes
|
data/grpc_c.64.ruby
ADDED
File without changes
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Copyright 2015, Google Inc.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are
|
6
|
+
# met:
|
7
|
+
#
|
8
|
+
# * Redistributions of source code must retain the above copyright
|
9
|
+
# notice, this list of conditions and the following disclaimer.
|
10
|
+
# * Redistributions in binary form must reproduce the above
|
11
|
+
# copyright notice, this list of conditions and the following disclaimer
|
12
|
+
# in the documentation and/or other materials provided with the
|
13
|
+
# distribution.
|
14
|
+
# * Neither the name of Google Inc. nor the names of its
|
15
|
+
# contributors may be used to endorse or promote products derived from
|
16
|
+
# this software without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
+
|
30
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
31
|
+
# source: google/protobuf/empty.proto
|
32
|
+
|
33
|
+
require 'google/protobuf'
|
34
|
+
|
35
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
36
|
+
add_message "google.protobuf.Empty" do
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
module Google
|
41
|
+
module Protobuf
|
42
|
+
Empty = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.protobuf.Empty").msgclass
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,256 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Copyright 2015, Google Inc.
|
4
|
+
# All rights reserved.
|
5
|
+
#
|
6
|
+
# Redistribution and use in source and binary forms, with or without
|
7
|
+
# modification, are permitted provided that the following conditions are
|
8
|
+
# met:
|
9
|
+
#
|
10
|
+
# * Redistributions of source code must retain the above copyright
|
11
|
+
# notice, this list of conditions and the following disclaimer.
|
12
|
+
# * Redistributions in binary form must reproduce the above
|
13
|
+
# copyright notice, this list of conditions and the following disclaimer
|
14
|
+
# in the documentation and/or other materials provided with the
|
15
|
+
# distribution.
|
16
|
+
# * Neither the name of Google Inc. nor the names of its
|
17
|
+
# contributors may be used to endorse or promote products derived from
|
18
|
+
# this software without specific prior written permission.
|
19
|
+
#
|
20
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
23
|
+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
24
|
+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
25
|
+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
26
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
27
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
28
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
29
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
+
|
32
|
+
# pubsub_demo demos accesses the Google PubSub API via its gRPC interface
|
33
|
+
#
|
34
|
+
# $ GOOGLE_APPLICATION_CREDENTIALS=<path_to_service_account_key_file> \
|
35
|
+
# path/to/pubsub_demo.rb \
|
36
|
+
# [--action=<chosen_demo_action> ]
|
37
|
+
#
|
38
|
+
# There are options related to the chosen action, see #parse_args below.
|
39
|
+
# - the possible actions are given by the method names of NamedAction class
|
40
|
+
# - the default action is list_some_topics
|
41
|
+
|
42
|
+
this_dir = File.expand_path(File.dirname(__FILE__))
|
43
|
+
lib_dir = File.join(File.dirname(File.dirname(this_dir)), 'lib')
|
44
|
+
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
45
|
+
$LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir)
|
46
|
+
|
47
|
+
require 'optparse'
|
48
|
+
|
49
|
+
require 'grpc'
|
50
|
+
require 'googleauth'
|
51
|
+
require 'google/protobuf'
|
52
|
+
|
53
|
+
require 'google/protobuf/empty'
|
54
|
+
require 'tech/pubsub/proto/pubsub'
|
55
|
+
require 'tech/pubsub/proto/pubsub_services'
|
56
|
+
|
57
|
+
# creates a SSL Credentials from the production certificates.
|
58
|
+
def ssl_creds
|
59
|
+
GRPC::Core::ChannelCredentials.new()
|
60
|
+
end
|
61
|
+
|
62
|
+
# Builds the metadata authentication update proc.
|
63
|
+
def auth_proc(opts)
|
64
|
+
auth_creds = Google::Auth.get_application_default
|
65
|
+
return auth_creds.updater_proc
|
66
|
+
end
|
67
|
+
|
68
|
+
# Creates a stub for accessing the publisher service.
|
69
|
+
def publisher_stub(opts)
|
70
|
+
address = "#{opts.host}:#{opts.port}"
|
71
|
+
stub_clz = Tech::Pubsub::PublisherService::Stub # shorter
|
72
|
+
GRPC.logger.info("... access PublisherService at #{address}")
|
73
|
+
call_creds = GRPC::Core::CallCredentials.new(auth_proc(opts))
|
74
|
+
combined_creds = ssl_creds.compose(call_creds)
|
75
|
+
stub_clz.new(address, creds: combined_creds,
|
76
|
+
GRPC::Core::Channel::SSL_TARGET => opts.host)
|
77
|
+
end
|
78
|
+
|
79
|
+
# Creates a stub for accessing the subscriber service.
|
80
|
+
def subscriber_stub(opts)
|
81
|
+
address = "#{opts.host}:#{opts.port}"
|
82
|
+
stub_clz = Tech::Pubsub::SubscriberService::Stub # shorter
|
83
|
+
GRPC.logger.info("... access SubscriberService at #{address}")
|
84
|
+
call_creds = GRPC::Core::CallCredentials.new(auth_proc(opts))
|
85
|
+
combined_creds = ssl_creds.compose(call_creds)
|
86
|
+
stub_clz.new(address, creds: combined_creds,
|
87
|
+
GRPC::Core::Channel::SSL_TARGET => opts.host)
|
88
|
+
end
|
89
|
+
|
90
|
+
# defines methods corresponding to each interop test case.
|
91
|
+
class NamedActions
|
92
|
+
include Tech::Pubsub
|
93
|
+
|
94
|
+
# Initializes NamedActions
|
95
|
+
#
|
96
|
+
# @param pub [Stub] a stub for accessing the publisher service
|
97
|
+
# @param sub [Stub] a stub for accessing the publisher service
|
98
|
+
# @param args [Args] provides access to the command line
|
99
|
+
def initialize(pub, sub, args)
|
100
|
+
@pub = pub
|
101
|
+
@sub = sub
|
102
|
+
@args = args
|
103
|
+
end
|
104
|
+
|
105
|
+
# Removes the test topic if it exists
|
106
|
+
def remove_topic
|
107
|
+
name = test_topic_name
|
108
|
+
p "... removing Topic #{name}"
|
109
|
+
@pub.delete_topic(DeleteTopicRequest.new(topic: name))
|
110
|
+
p "removed Topic: #{name} OK"
|
111
|
+
rescue GRPC::BadStatus => e
|
112
|
+
p "Could not delete a topics: rpc failed with '#{e}'"
|
113
|
+
end
|
114
|
+
|
115
|
+
# Creates a test topic
|
116
|
+
def create_topic
|
117
|
+
name = test_topic_name
|
118
|
+
p "... creating Topic #{name}"
|
119
|
+
resp = @pub.create_topic(Topic.new(name: name))
|
120
|
+
p "created Topic: #{resp.name} OK"
|
121
|
+
rescue GRPC::BadStatus => e
|
122
|
+
p "Could not create a topics: rpc failed with '#{e}'"
|
123
|
+
end
|
124
|
+
|
125
|
+
# Lists topics in the project
|
126
|
+
def list_some_topics
|
127
|
+
p 'Listing topics'
|
128
|
+
p '-------------_'
|
129
|
+
list_project_topics.topic.each { |t| p t.name }
|
130
|
+
rescue GRPC::BadStatus => e
|
131
|
+
p "Could not list topics: rpc failed with '#{e}'"
|
132
|
+
end
|
133
|
+
|
134
|
+
# Checks if a topics exists in a project
|
135
|
+
def check_exists
|
136
|
+
name = test_topic_name
|
137
|
+
p "... checking for topic #{name}"
|
138
|
+
exists = topic_exists?(name)
|
139
|
+
p "#{name} is a topic" if exists
|
140
|
+
p "#{name} is not a topic" unless exists
|
141
|
+
rescue GRPC::BadStatus => e
|
142
|
+
p "Could not check for a topics: rpc failed with '#{e}'"
|
143
|
+
end
|
144
|
+
|
145
|
+
# Publishes some messages
|
146
|
+
def random_pub_sub
|
147
|
+
topic_name, sub_name = test_topic_name, test_sub_name
|
148
|
+
create_topic_if_needed(topic_name)
|
149
|
+
@sub.create_subscription(Subscription.new(name: sub_name,
|
150
|
+
topic: topic_name))
|
151
|
+
msg_count = rand(10..30)
|
152
|
+
msg_count.times do |x|
|
153
|
+
msg = PubsubMessage.new(data: "message #{x}")
|
154
|
+
@pub.publish(PublishRequest.new(topic: topic_name, message: msg))
|
155
|
+
end
|
156
|
+
p "Sent #{msg_count} messages to #{topic_name}, checking for them now."
|
157
|
+
batch = @sub.pull_batch(PullBatchRequest.new(subscription: sub_name,
|
158
|
+
max_events: msg_count))
|
159
|
+
ack_ids = batch.pull_responses.map { |x| x.ack_id }
|
160
|
+
p "Got #{ack_ids.size} messages; acknowledging them.."
|
161
|
+
@sub.acknowledge(AcknowledgeRequest.new(subscription: sub_name,
|
162
|
+
ack_id: ack_ids))
|
163
|
+
p "Test messages were acknowledged OK, deleting the subscription"
|
164
|
+
del_req = DeleteSubscriptionRequest.new(subscription: sub_name)
|
165
|
+
@sub.delete_subscription(del_req)
|
166
|
+
rescue GRPC::BadStatus => e
|
167
|
+
p "Could not do random pub sub: rpc failed with '#{e}'"
|
168
|
+
end
|
169
|
+
|
170
|
+
private
|
171
|
+
|
172
|
+
# test_topic_name is the topic name to use in this test.
|
173
|
+
def test_topic_name
|
174
|
+
unless @args.topic_name.nil?
|
175
|
+
return "/topics/#{@args.project_id}/#{@args.topic_name}"
|
176
|
+
end
|
177
|
+
now_text = Time.now.utc.strftime('%Y%m%d%H%M%S%L')
|
178
|
+
"/topics/#{@args.project_id}/#{ENV['USER']}-#{now_text}"
|
179
|
+
end
|
180
|
+
|
181
|
+
# test_sub_name is the subscription name to use in this test.
|
182
|
+
def test_sub_name
|
183
|
+
unless @args.sub_name.nil?
|
184
|
+
return "/subscriptions/#{@args.project_id}/#{@args.sub_name}"
|
185
|
+
end
|
186
|
+
now_text = Time.now.utc.strftime('%Y%m%d%H%M%S%L')
|
187
|
+
"/subscriptions/#{@args.project_id}/#{ENV['USER']}-#{now_text}"
|
188
|
+
end
|
189
|
+
|
190
|
+
# determines if the topic name exists
|
191
|
+
def topic_exists?(name)
|
192
|
+
topics = list_project_topics.topic.map { |t| t.name }
|
193
|
+
topics.include?(name)
|
194
|
+
end
|
195
|
+
|
196
|
+
def create_topic_if_needed(name)
|
197
|
+
return if topic_exists?(name)
|
198
|
+
@pub.create_topic(Topic.new(name: name))
|
199
|
+
end
|
200
|
+
|
201
|
+
def list_project_topics
|
202
|
+
q = "cloud.googleapis.com/project in (/projects/#{@args.project_id})"
|
203
|
+
@pub.list_topics(ListTopicsRequest.new(query: q))
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
# Args is used to hold the command line info.
|
208
|
+
Args = Struct.new(:host, :port, :action, :project_id, :topic_name,
|
209
|
+
:sub_name)
|
210
|
+
|
211
|
+
# validates the the command line options, returning them as an Arg.
|
212
|
+
def parse_args
|
213
|
+
args = Args.new('pubsub-staging.googleapis.com',
|
214
|
+
443, 'list_some_topics', 'stoked-keyword-656')
|
215
|
+
OptionParser.new do |opts|
|
216
|
+
opts.on('--server_host SERVER_HOST', 'server hostname') do |v|
|
217
|
+
args.host = v
|
218
|
+
end
|
219
|
+
opts.on('--server_port SERVER_PORT', 'server port') do |v|
|
220
|
+
args.port = v
|
221
|
+
end
|
222
|
+
|
223
|
+
# instance_methods(false) gives only the methods defined in that class.
|
224
|
+
scenes = NamedActions.instance_methods(false).map { |t| t.to_s }
|
225
|
+
scene_list = scenes.join(',')
|
226
|
+
opts.on("--action CODE", scenes, {}, 'pick a demo action',
|
227
|
+
" (#{scene_list})") do |v|
|
228
|
+
args.action = v
|
229
|
+
end
|
230
|
+
|
231
|
+
# Set the remaining values.
|
232
|
+
%w(project_id topic_name sub_name).each do |o|
|
233
|
+
opts.on("--#{o} VALUE", "#{o}") do |v|
|
234
|
+
args[o] = v
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end.parse!
|
238
|
+
_check_args(args)
|
239
|
+
end
|
240
|
+
|
241
|
+
def _check_args(args)
|
242
|
+
%w(host port action).each do |a|
|
243
|
+
if args[a].nil?
|
244
|
+
raise OptionParser::MissingArgument.new("please specify --#{a}")
|
245
|
+
end
|
246
|
+
end
|
247
|
+
args
|
248
|
+
end
|
249
|
+
|
250
|
+
def main
|
251
|
+
args = parse_args
|
252
|
+
pub, sub = publisher_stub(args), subscriber_stub(args)
|
253
|
+
NamedActions.new(pub, sub, args).method(args.action).call
|
254
|
+
end
|
255
|
+
|
256
|
+
main
|
@@ -0,0 +1,174 @@
|
|
1
|
+
# Copyright 2015, Google Inc.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are
|
6
|
+
# met:
|
7
|
+
#
|
8
|
+
# * Redistributions of source code must retain the above copyright
|
9
|
+
# notice, this list of conditions and the following disclaimer.
|
10
|
+
# * Redistributions in binary form must reproduce the above
|
11
|
+
# copyright notice, this list of conditions and the following disclaimer
|
12
|
+
# in the documentation and/or other materials provided with the
|
13
|
+
# distribution.
|
14
|
+
# * Neither the name of Google Inc. nor the names of its
|
15
|
+
# contributors may be used to endorse or promote products derived from
|
16
|
+
# this software without specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
+
|
30
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
31
|
+
# source: tech/pubsub/proto/pubsub.proto
|
32
|
+
|
33
|
+
require 'google/protobuf'
|
34
|
+
|
35
|
+
require 'google/protobuf/empty'
|
36
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
37
|
+
add_message "tech.pubsub.Topic" do
|
38
|
+
optional :name, :string, 1
|
39
|
+
end
|
40
|
+
add_message "tech.pubsub.PubsubMessage" do
|
41
|
+
optional :data, :string, 1
|
42
|
+
optional :message_id, :string, 3
|
43
|
+
end
|
44
|
+
add_message "tech.pubsub.GetTopicRequest" do
|
45
|
+
optional :topic, :string, 1
|
46
|
+
end
|
47
|
+
add_message "tech.pubsub.PublishRequest" do
|
48
|
+
optional :topic, :string, 1
|
49
|
+
optional :message, :message, 2, "tech.pubsub.PubsubMessage"
|
50
|
+
end
|
51
|
+
add_message "tech.pubsub.PublishBatchRequest" do
|
52
|
+
optional :topic, :string, 1
|
53
|
+
repeated :messages, :message, 2, "tech.pubsub.PubsubMessage"
|
54
|
+
end
|
55
|
+
add_message "tech.pubsub.PublishBatchResponse" do
|
56
|
+
repeated :message_ids, :string, 1
|
57
|
+
end
|
58
|
+
add_message "tech.pubsub.ListTopicsRequest" do
|
59
|
+
optional :query, :string, 1
|
60
|
+
optional :max_results, :int32, 2
|
61
|
+
optional :page_token, :string, 3
|
62
|
+
end
|
63
|
+
add_message "tech.pubsub.ListTopicsResponse" do
|
64
|
+
repeated :topic, :message, 1, "tech.pubsub.Topic"
|
65
|
+
optional :next_page_token, :string, 2
|
66
|
+
end
|
67
|
+
add_message "tech.pubsub.DeleteTopicRequest" do
|
68
|
+
optional :topic, :string, 1
|
69
|
+
end
|
70
|
+
add_message "tech.pubsub.Subscription" do
|
71
|
+
optional :name, :string, 1
|
72
|
+
optional :topic, :string, 2
|
73
|
+
optional :query, :string, 3
|
74
|
+
optional :truncation_policy, :message, 4, "tech.pubsub.Subscription.TruncationPolicy"
|
75
|
+
optional :push_config, :message, 5, "tech.pubsub.PushConfig"
|
76
|
+
optional :ack_deadline_seconds, :int32, 6
|
77
|
+
optional :garbage_collect_seconds, :int64, 7
|
78
|
+
end
|
79
|
+
add_message "tech.pubsub.Subscription.TruncationPolicy" do
|
80
|
+
optional :max_bytes, :int64, 1
|
81
|
+
optional :max_age_seconds, :int64, 2
|
82
|
+
end
|
83
|
+
add_message "tech.pubsub.PushConfig" do
|
84
|
+
optional :push_endpoint, :string, 1
|
85
|
+
end
|
86
|
+
add_message "tech.pubsub.PubsubEvent" do
|
87
|
+
optional :subscription, :string, 1
|
88
|
+
optional :message, :message, 2, "tech.pubsub.PubsubMessage"
|
89
|
+
optional :truncated, :bool, 3
|
90
|
+
optional :deleted, :bool, 4
|
91
|
+
end
|
92
|
+
add_message "tech.pubsub.GetSubscriptionRequest" do
|
93
|
+
optional :subscription, :string, 1
|
94
|
+
end
|
95
|
+
add_message "tech.pubsub.ListSubscriptionsRequest" do
|
96
|
+
optional :query, :string, 1
|
97
|
+
optional :max_results, :int32, 3
|
98
|
+
optional :page_token, :string, 4
|
99
|
+
end
|
100
|
+
add_message "tech.pubsub.ListSubscriptionsResponse" do
|
101
|
+
repeated :subscription, :message, 1, "tech.pubsub.Subscription"
|
102
|
+
optional :next_page_token, :string, 2
|
103
|
+
end
|
104
|
+
add_message "tech.pubsub.TruncateSubscriptionRequest" do
|
105
|
+
optional :subscription, :string, 1
|
106
|
+
end
|
107
|
+
add_message "tech.pubsub.DeleteSubscriptionRequest" do
|
108
|
+
optional :subscription, :string, 1
|
109
|
+
end
|
110
|
+
add_message "tech.pubsub.ModifyPushConfigRequest" do
|
111
|
+
optional :subscription, :string, 1
|
112
|
+
optional :push_config, :message, 2, "tech.pubsub.PushConfig"
|
113
|
+
end
|
114
|
+
add_message "tech.pubsub.PullRequest" do
|
115
|
+
optional :subscription, :string, 1
|
116
|
+
optional :return_immediately, :bool, 2
|
117
|
+
end
|
118
|
+
add_message "tech.pubsub.PullResponse" do
|
119
|
+
optional :ack_id, :string, 1
|
120
|
+
optional :pubsub_event, :message, 2, "tech.pubsub.PubsubEvent"
|
121
|
+
end
|
122
|
+
add_message "tech.pubsub.PullBatchRequest" do
|
123
|
+
optional :subscription, :string, 1
|
124
|
+
optional :return_immediately, :bool, 2
|
125
|
+
optional :max_events, :int32, 3
|
126
|
+
end
|
127
|
+
add_message "tech.pubsub.PullBatchResponse" do
|
128
|
+
repeated :pull_responses, :message, 2, "tech.pubsub.PullResponse"
|
129
|
+
end
|
130
|
+
add_message "tech.pubsub.ModifyAckDeadlineRequest" do
|
131
|
+
optional :subscription, :string, 1
|
132
|
+
optional :ack_id, :string, 2
|
133
|
+
optional :ack_deadline_seconds, :int32, 3
|
134
|
+
end
|
135
|
+
add_message "tech.pubsub.AcknowledgeRequest" do
|
136
|
+
optional :subscription, :string, 1
|
137
|
+
repeated :ack_id, :string, 2
|
138
|
+
end
|
139
|
+
add_message "tech.pubsub.NackRequest" do
|
140
|
+
optional :subscription, :string, 1
|
141
|
+
repeated :ack_id, :string, 2
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
module Tech
|
146
|
+
module Pubsub
|
147
|
+
Topic = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.Topic").msgclass
|
148
|
+
PubsubMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.PubsubMessage").msgclass
|
149
|
+
GetTopicRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.GetTopicRequest").msgclass
|
150
|
+
PublishRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.PublishRequest").msgclass
|
151
|
+
PublishBatchRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.PublishBatchRequest").msgclass
|
152
|
+
PublishBatchResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.PublishBatchResponse").msgclass
|
153
|
+
ListTopicsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.ListTopicsRequest").msgclass
|
154
|
+
ListTopicsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.ListTopicsResponse").msgclass
|
155
|
+
DeleteTopicRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.DeleteTopicRequest").msgclass
|
156
|
+
Subscription = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.Subscription").msgclass
|
157
|
+
Subscription::TruncationPolicy = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.Subscription.TruncationPolicy").msgclass
|
158
|
+
PushConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.PushConfig").msgclass
|
159
|
+
PubsubEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.PubsubEvent").msgclass
|
160
|
+
GetSubscriptionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.GetSubscriptionRequest").msgclass
|
161
|
+
ListSubscriptionsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.ListSubscriptionsRequest").msgclass
|
162
|
+
ListSubscriptionsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.ListSubscriptionsResponse").msgclass
|
163
|
+
TruncateSubscriptionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.TruncateSubscriptionRequest").msgclass
|
164
|
+
DeleteSubscriptionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.DeleteSubscriptionRequest").msgclass
|
165
|
+
ModifyPushConfigRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.ModifyPushConfigRequest").msgclass
|
166
|
+
PullRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.PullRequest").msgclass
|
167
|
+
PullResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.PullResponse").msgclass
|
168
|
+
PullBatchRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.PullBatchRequest").msgclass
|
169
|
+
PullBatchResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.PullBatchResponse").msgclass
|
170
|
+
ModifyAckDeadlineRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.ModifyAckDeadlineRequest").msgclass
|
171
|
+
AcknowledgeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.AcknowledgeRequest").msgclass
|
172
|
+
NackRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("tech.pubsub.NackRequest").msgclass
|
173
|
+
end
|
174
|
+
end
|