-
Notifications
You must be signed in to change notification settings - Fork 0
/
datahash_pb2_grpc.py
257 lines (232 loc) · 10.4 KB
/
datahash_pb2_grpc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import datahash_pb2 as datahash__pb2
class DataHashStub(object):
"""Missing associated documentation comment in .proto file."""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.get_image = channel.unary_unary(
'/DataHash/get_image',
request_serializer=datahash__pb2.Text.SerializeToString,
response_deserializer=datahash__pb2.Image.FromString,
)
self.hash_md5 = channel.unary_unary(
'/DataHash/hash_md5',
request_serializer=datahash__pb2.Text.SerializeToString,
response_deserializer=datahash__pb2.Text.FromString,
)
self.hash_sha256 = channel.unary_unary(
'/DataHash/hash_sha256',
request_serializer=datahash__pb2.Text.SerializeToString,
response_deserializer=datahash__pb2.Text.FromString,
)
self.hello = channel.unary_unary(
'/DataHash/hello',
request_serializer=datahash__pb2.Text.SerializeToString,
response_deserializer=datahash__pb2.Text.FromString,
)
self.stream_text = channel.unary_stream(
'/DataHash/stream_text',
request_serializer=datahash__pb2.Text.SerializeToString,
response_deserializer=datahash__pb2.Text.FromString,
)
self.input_stream = channel.stream_unary(
'/DataHash/input_stream',
request_serializer=datahash__pb2.Text.SerializeToString,
response_deserializer=datahash__pb2.Text.FromString,
)
self.dual_stream = channel.stream_stream(
'/DataHash/dual_stream',
request_serializer=datahash__pb2.Text.SerializeToString,
response_deserializer=datahash__pb2.Text.FromString,
)
class DataHashServicer(object):
"""Missing associated documentation comment in .proto file."""
def get_image(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def hash_md5(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def hash_sha256(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def hello(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def stream_text(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def input_stream(self, request_iterator, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def dual_stream(self, request_iterator, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_DataHashServicer_to_server(servicer, server):
rpc_method_handlers = {
'get_image': grpc.unary_unary_rpc_method_handler(
servicer.get_image,
request_deserializer=datahash__pb2.Text.FromString,
response_serializer=datahash__pb2.Image.SerializeToString,
),
'hash_md5': grpc.unary_unary_rpc_method_handler(
servicer.hash_md5,
request_deserializer=datahash__pb2.Text.FromString,
response_serializer=datahash__pb2.Text.SerializeToString,
),
'hash_sha256': grpc.unary_unary_rpc_method_handler(
servicer.hash_sha256,
request_deserializer=datahash__pb2.Text.FromString,
response_serializer=datahash__pb2.Text.SerializeToString,
),
'hello': grpc.unary_unary_rpc_method_handler(
servicer.hello,
request_deserializer=datahash__pb2.Text.FromString,
response_serializer=datahash__pb2.Text.SerializeToString,
),
'stream_text': grpc.unary_stream_rpc_method_handler(
servicer.stream_text,
request_deserializer=datahash__pb2.Text.FromString,
response_serializer=datahash__pb2.Text.SerializeToString,
),
'input_stream': grpc.stream_unary_rpc_method_handler(
servicer.input_stream,
request_deserializer=datahash__pb2.Text.FromString,
response_serializer=datahash__pb2.Text.SerializeToString,
),
'dual_stream': grpc.stream_stream_rpc_method_handler(
servicer.dual_stream,
request_deserializer=datahash__pb2.Text.FromString,
response_serializer=datahash__pb2.Text.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'DataHash', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class DataHash(object):
"""Missing associated documentation comment in .proto file."""
@staticmethod
def get_image(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/DataHash/get_image',
datahash__pb2.Text.SerializeToString,
datahash__pb2.Image.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def hash_md5(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/DataHash/hash_md5',
datahash__pb2.Text.SerializeToString,
datahash__pb2.Text.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def hash_sha256(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/DataHash/hash_sha256',
datahash__pb2.Text.SerializeToString,
datahash__pb2.Text.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def hello(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/DataHash/hello',
datahash__pb2.Text.SerializeToString,
datahash__pb2.Text.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def stream_text(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/DataHash/stream_text',
datahash__pb2.Text.SerializeToString,
datahash__pb2.Text.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def input_stream(request_iterator,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.stream_unary(request_iterator, target, '/DataHash/input_stream',
datahash__pb2.Text.SerializeToString,
datahash__pb2.Text.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def dual_stream(request_iterator,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.stream_stream(request_iterator, target, '/DataHash/dual_stream',
datahash__pb2.Text.SerializeToString,
datahash__pb2.Text.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)