blob: 33fe7ebbaf0c129df5c5818bb466058f84ad8beb [file] [log] [blame]
Zsolt Harasztie39523b2016-10-16 19:30:34 -07001# Generated by the protocol buffer compiler. DO NOT EDIT!
2# source: streaming.proto
3
4import sys
5_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
6from google.protobuf import descriptor as _descriptor
7from google.protobuf import message as _message
8from google.protobuf import reflection as _reflection
9from google.protobuf import symbol_database as _symbol_database
10from google.protobuf import descriptor_pb2
11# @@protoc_insertion_point(imports)
12
13_sym_db = _symbol_database.Default()
14
15
16from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
17
18
19DESCRIPTOR = _descriptor.FileDescriptor(
20 name='streaming.proto',
21 package='experiment',
22 syntax='proto3',
23 serialized_pb=_b('\n\x0fstreaming.proto\x12\nexperiment\x1a\x1bgoogle/protobuf/empty.proto\"\x92\x01\n\nAsyncEvent\x12\x0b\n\x03seq\x18\x01 \x01(\x05\x12.\n\x04type\x18\x02 \x01(\x0e\x32 .experiment.AsyncEvent.EventType\x12\x0f\n\x07\x64\x65tails\x18\x03 \x01(\t\"6\n\tEventType\x12\x0c\n\x08\x42IG_BANG\x10\x00\x12\x0e\n\nSMALL_BANG\x10\x01\x12\x0b\n\x07NO_BANG\x10\x02\")\n\x06Packet\x12\x0e\n\x06source\x18\x01 \x01(\x05\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\x0c\"\"\n\x04\x45\x63ho\x12\x0b\n\x03msg\x18\x01 \x01(\t\x12\r\n\x05\x64\x65lay\x18\x02 \x01(\x02\x32\x8c\x02\n\x13\x45xperimentalService\x12-\n\x07GetEcho\x12\x10.experiment.Echo\x1a\x10.experiment.Echo\x12I\n\x15ReceiveStreamedEvents\x12\x16.google.protobuf.Empty\x1a\x16.experiment.AsyncEvent0\x01\x12>\n\x0eReceivePackets\x12\x16.google.protobuf.Empty\x1a\x12.experiment.Packet0\x01\x12;\n\x0bSendPackets\x12\x12.experiment.Packet\x1a\x16.google.protobuf.Empty(\x01\x62\x06proto3')
24 ,
25 dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,])
26_sym_db.RegisterFileDescriptor(DESCRIPTOR)
27
28
29
30_ASYNCEVENT_EVENTTYPE = _descriptor.EnumDescriptor(
31 name='EventType',
32 full_name='experiment.AsyncEvent.EventType',
33 filename=None,
34 file=DESCRIPTOR,
35 values=[
36 _descriptor.EnumValueDescriptor(
37 name='BIG_BANG', index=0, number=0,
38 options=None,
39 type=None),
40 _descriptor.EnumValueDescriptor(
41 name='SMALL_BANG', index=1, number=1,
42 options=None,
43 type=None),
44 _descriptor.EnumValueDescriptor(
45 name='NO_BANG', index=2, number=2,
46 options=None,
47 type=None),
48 ],
49 containing_type=None,
50 options=None,
51 serialized_start=153,
52 serialized_end=207,
53)
54_sym_db.RegisterEnumDescriptor(_ASYNCEVENT_EVENTTYPE)
55
56
57_ASYNCEVENT = _descriptor.Descriptor(
58 name='AsyncEvent',
59 full_name='experiment.AsyncEvent',
60 filename=None,
61 file=DESCRIPTOR,
62 containing_type=None,
63 fields=[
64 _descriptor.FieldDescriptor(
65 name='seq', full_name='experiment.AsyncEvent.seq', index=0,
66 number=1, type=5, cpp_type=1, label=1,
67 has_default_value=False, default_value=0,
68 message_type=None, enum_type=None, containing_type=None,
69 is_extension=False, extension_scope=None,
70 options=None),
71 _descriptor.FieldDescriptor(
72 name='type', full_name='experiment.AsyncEvent.type', index=1,
73 number=2, type=14, cpp_type=8, label=1,
74 has_default_value=False, default_value=0,
75 message_type=None, enum_type=None, containing_type=None,
76 is_extension=False, extension_scope=None,
77 options=None),
78 _descriptor.FieldDescriptor(
79 name='details', full_name='experiment.AsyncEvent.details', index=2,
80 number=3, type=9, cpp_type=9, label=1,
81 has_default_value=False, default_value=_b("").decode('utf-8'),
82 message_type=None, enum_type=None, containing_type=None,
83 is_extension=False, extension_scope=None,
84 options=None),
85 ],
86 extensions=[
87 ],
88 nested_types=[],
89 enum_types=[
90 _ASYNCEVENT_EVENTTYPE,
91 ],
92 options=None,
93 is_extendable=False,
94 syntax='proto3',
95 extension_ranges=[],
96 oneofs=[
97 ],
98 serialized_start=61,
99 serialized_end=207,
100)
101
102
103_PACKET = _descriptor.Descriptor(
104 name='Packet',
105 full_name='experiment.Packet',
106 filename=None,
107 file=DESCRIPTOR,
108 containing_type=None,
109 fields=[
110 _descriptor.FieldDescriptor(
111 name='source', full_name='experiment.Packet.source', index=0,
112 number=1, type=5, cpp_type=1, label=1,
113 has_default_value=False, default_value=0,
114 message_type=None, enum_type=None, containing_type=None,
115 is_extension=False, extension_scope=None,
116 options=None),
117 _descriptor.FieldDescriptor(
118 name='content', full_name='experiment.Packet.content', index=1,
119 number=2, type=12, cpp_type=9, label=1,
120 has_default_value=False, default_value=_b(""),
121 message_type=None, enum_type=None, containing_type=None,
122 is_extension=False, extension_scope=None,
123 options=None),
124 ],
125 extensions=[
126 ],
127 nested_types=[],
128 enum_types=[
129 ],
130 options=None,
131 is_extendable=False,
132 syntax='proto3',
133 extension_ranges=[],
134 oneofs=[
135 ],
136 serialized_start=209,
137 serialized_end=250,
138)
139
140
141_ECHO = _descriptor.Descriptor(
142 name='Echo',
143 full_name='experiment.Echo',
144 filename=None,
145 file=DESCRIPTOR,
146 containing_type=None,
147 fields=[
148 _descriptor.FieldDescriptor(
149 name='msg', full_name='experiment.Echo.msg', index=0,
150 number=1, type=9, cpp_type=9, label=1,
151 has_default_value=False, default_value=_b("").decode('utf-8'),
152 message_type=None, enum_type=None, containing_type=None,
153 is_extension=False, extension_scope=None,
154 options=None),
155 _descriptor.FieldDescriptor(
156 name='delay', full_name='experiment.Echo.delay', index=1,
157 number=2, type=2, cpp_type=6, label=1,
158 has_default_value=False, default_value=float(0),
159 message_type=None, enum_type=None, containing_type=None,
160 is_extension=False, extension_scope=None,
161 options=None),
162 ],
163 extensions=[
164 ],
165 nested_types=[],
166 enum_types=[
167 ],
168 options=None,
169 is_extendable=False,
170 syntax='proto3',
171 extension_ranges=[],
172 oneofs=[
173 ],
174 serialized_start=252,
175 serialized_end=286,
176)
177
178_ASYNCEVENT.fields_by_name['type'].enum_type = _ASYNCEVENT_EVENTTYPE
179_ASYNCEVENT_EVENTTYPE.containing_type = _ASYNCEVENT
180DESCRIPTOR.message_types_by_name['AsyncEvent'] = _ASYNCEVENT
181DESCRIPTOR.message_types_by_name['Packet'] = _PACKET
182DESCRIPTOR.message_types_by_name['Echo'] = _ECHO
183
184AsyncEvent = _reflection.GeneratedProtocolMessageType('AsyncEvent', (_message.Message,), dict(
185 DESCRIPTOR = _ASYNCEVENT,
186 __module__ = 'streaming_pb2'
187 # @@protoc_insertion_point(class_scope:experiment.AsyncEvent)
188 ))
189_sym_db.RegisterMessage(AsyncEvent)
190
191Packet = _reflection.GeneratedProtocolMessageType('Packet', (_message.Message,), dict(
192 DESCRIPTOR = _PACKET,
193 __module__ = 'streaming_pb2'
194 # @@protoc_insertion_point(class_scope:experiment.Packet)
195 ))
196_sym_db.RegisterMessage(Packet)
197
198Echo = _reflection.GeneratedProtocolMessageType('Echo', (_message.Message,), dict(
199 DESCRIPTOR = _ECHO,
200 __module__ = 'streaming_pb2'
201 # @@protoc_insertion_point(class_scope:experiment.Echo)
202 ))
203_sym_db.RegisterMessage(Echo)
204
205
206import grpc
207from grpc.beta import implementations as beta_implementations
208from grpc.beta import interfaces as beta_interfaces
209from grpc.framework.common import cardinality
210from grpc.framework.interfaces.face import utilities as face_utilities
211
212
213class ExperimentalServiceStub(object):
214
215 def __init__(self, channel):
216 """Constructor.
217
218 Args:
219 channel: A grpc.Channel.
220 """
221 self.GetEcho = channel.unary_unary(
222 '/experiment.ExperimentalService/GetEcho',
223 request_serializer=Echo.SerializeToString,
224 response_deserializer=Echo.FromString,
225 )
226 self.ReceiveStreamedEvents = channel.unary_stream(
227 '/experiment.ExperimentalService/ReceiveStreamedEvents',
228 request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
229 response_deserializer=AsyncEvent.FromString,
230 )
231 self.ReceivePackets = channel.unary_stream(
232 '/experiment.ExperimentalService/ReceivePackets',
233 request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
234 response_deserializer=Packet.FromString,
235 )
236 self.SendPackets = channel.stream_unary(
237 '/experiment.ExperimentalService/SendPackets',
238 request_serializer=Packet.SerializeToString,
239 response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
240 )
241
242
243class ExperimentalServiceServicer(object):
244
245 def GetEcho(self, request, context):
246 context.set_code(grpc.StatusCode.UNIMPLEMENTED)
247 context.set_details('Method not implemented!')
248 raise NotImplementedError('Method not implemented!')
249
250 def ReceiveStreamedEvents(self, request, context):
251 """For server to send async stream to client
252 """
253 context.set_code(grpc.StatusCode.UNIMPLEMENTED)
254 context.set_details('Method not implemented!')
255 raise NotImplementedError('Method not implemented!')
256
257 def ReceivePackets(self, request, context):
258 """For server to send async packets to client
259 """
260 context.set_code(grpc.StatusCode.UNIMPLEMENTED)
261 context.set_details('Method not implemented!')
262 raise NotImplementedError('Method not implemented!')
263
264 def SendPackets(self, request_iterator, context):
265 """For client to send async packets to server
266 """
267 context.set_code(grpc.StatusCode.UNIMPLEMENTED)
268 context.set_details('Method not implemented!')
269 raise NotImplementedError('Method not implemented!')
270
271
272def add_ExperimentalServiceServicer_to_server(servicer, server):
273 rpc_method_handlers = {
274 'GetEcho': grpc.unary_unary_rpc_method_handler(
275 servicer.GetEcho,
276 request_deserializer=Echo.FromString,
277 response_serializer=Echo.SerializeToString,
278 ),
279 'ReceiveStreamedEvents': grpc.unary_stream_rpc_method_handler(
280 servicer.ReceiveStreamedEvents,
281 request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
282 response_serializer=AsyncEvent.SerializeToString,
283 ),
284 'ReceivePackets': grpc.unary_stream_rpc_method_handler(
285 servicer.ReceivePackets,
286 request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
287 response_serializer=Packet.SerializeToString,
288 ),
289 'SendPackets': grpc.stream_unary_rpc_method_handler(
290 servicer.SendPackets,
291 request_deserializer=Packet.FromString,
292 response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
293 ),
294 }
295 generic_handler = grpc.method_handlers_generic_handler(
296 'experiment.ExperimentalService', rpc_method_handlers)
297 server.add_generic_rpc_handlers((generic_handler,))
298
299
300class BetaExperimentalServiceServicer(object):
301 def GetEcho(self, request, context):
302 context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
303 def ReceiveStreamedEvents(self, request, context):
304 """For server to send async stream to client
305 """
306 context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
307 def ReceivePackets(self, request, context):
308 """For server to send async packets to client
309 """
310 context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
311 def SendPackets(self, request_iterator, context):
312 """For client to send async packets to server
313 """
314 context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
315
316
317class BetaExperimentalServiceStub(object):
318 def GetEcho(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
319 raise NotImplementedError()
320 GetEcho.future = None
321 def ReceiveStreamedEvents(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
322 """For server to send async stream to client
323 """
324 raise NotImplementedError()
325 def ReceivePackets(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
326 """For server to send async packets to client
327 """
328 raise NotImplementedError()
329 def SendPackets(self, request_iterator, timeout, metadata=None, with_call=False, protocol_options=None):
330 """For client to send async packets to server
331 """
332 raise NotImplementedError()
333 SendPackets.future = None
334
335
336def beta_create_ExperimentalService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
337 request_deserializers = {
338 ('experiment.ExperimentalService', 'GetEcho'): Echo.FromString,
339 ('experiment.ExperimentalService', 'ReceivePackets'): google_dot_protobuf_dot_empty__pb2.Empty.FromString,
340 ('experiment.ExperimentalService', 'ReceiveStreamedEvents'): google_dot_protobuf_dot_empty__pb2.Empty.FromString,
341 ('experiment.ExperimentalService', 'SendPackets'): Packet.FromString,
342 }
343 response_serializers = {
344 ('experiment.ExperimentalService', 'GetEcho'): Echo.SerializeToString,
345 ('experiment.ExperimentalService', 'ReceivePackets'): Packet.SerializeToString,
346 ('experiment.ExperimentalService', 'ReceiveStreamedEvents'): AsyncEvent.SerializeToString,
347 ('experiment.ExperimentalService', 'SendPackets'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
348 }
349 method_implementations = {
350 ('experiment.ExperimentalService', 'GetEcho'): face_utilities.unary_unary_inline(servicer.GetEcho),
351 ('experiment.ExperimentalService', 'ReceivePackets'): face_utilities.unary_stream_inline(servicer.ReceivePackets),
352 ('experiment.ExperimentalService', 'ReceiveStreamedEvents'): face_utilities.unary_stream_inline(servicer.ReceiveStreamedEvents),
353 ('experiment.ExperimentalService', 'SendPackets'): face_utilities.stream_unary_inline(servicer.SendPackets),
354 }
355 server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
356 return beta_implementations.server(method_implementations, options=server_options)
357
358
359def beta_create_ExperimentalService_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None):
360 request_serializers = {
361 ('experiment.ExperimentalService', 'GetEcho'): Echo.SerializeToString,
362 ('experiment.ExperimentalService', 'ReceivePackets'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
363 ('experiment.ExperimentalService', 'ReceiveStreamedEvents'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
364 ('experiment.ExperimentalService', 'SendPackets'): Packet.SerializeToString,
365 }
366 response_deserializers = {
367 ('experiment.ExperimentalService', 'GetEcho'): Echo.FromString,
368 ('experiment.ExperimentalService', 'ReceivePackets'): Packet.FromString,
369 ('experiment.ExperimentalService', 'ReceiveStreamedEvents'): AsyncEvent.FromString,
370 ('experiment.ExperimentalService', 'SendPackets'): google_dot_protobuf_dot_empty__pb2.Empty.FromString,
371 }
372 cardinalities = {
373 'GetEcho': cardinality.Cardinality.UNARY_UNARY,
374 'ReceivePackets': cardinality.Cardinality.UNARY_STREAM,
375 'ReceiveStreamedEvents': cardinality.Cardinality.UNARY_STREAM,
376 'SendPackets': cardinality.Cardinality.STREAM_UNARY,
377 }
378 stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size)
379 return beta_implementations.dynamic_stub(channel, 'experiment.ExperimentalService', cardinalities, options=stub_options)
380# @@protoc_insertion_point(module_scope)