-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchat_room_pb2_grpc.py
97 lines (84 loc) · 3.54 KB
/
chat_room_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
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import chat_room_pb2 as chat__room__pb2
class ChatRoomStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.RegisterUser = channel.unary_unary(
'/chatroom.ChatRoom/RegisterUser',
request_serializer=chat__room__pb2.User.SerializeToString,
response_deserializer=chat__room__pb2.Response.FromString,
)
self.ListUser = channel.unary_stream(
'/chatroom.ChatRoom/ListUser',
request_serializer=chat__room__pb2.Metadata.SerializeToString,
response_deserializer=chat__room__pb2.User.FromString,
)
self.SendMsg = channel.stream_unary(
'/chatroom.ChatRoom/SendMsg',
request_serializer=chat__room__pb2.Message.SerializeToString,
response_deserializer=chat__room__pb2.Response.FromString,
)
self.ReceiveMsg = channel.unary_stream(
'/chatroom.ChatRoom/ReceiveMsg',
request_serializer=chat__room__pb2.User.SerializeToString,
response_deserializer=chat__room__pb2.Message.FromString,
)
class ChatRoomServicer(object):
# missing associated documentation comment in .proto file
pass
def RegisterUser(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListUser(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SendMsg(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ReceiveMsg(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_ChatRoomServicer_to_server(servicer, server):
rpc_method_handlers = {
'RegisterUser': grpc.unary_unary_rpc_method_handler(
servicer.RegisterUser,
request_deserializer=chat__room__pb2.User.FromString,
response_serializer=chat__room__pb2.Response.SerializeToString,
),
'ListUser': grpc.unary_stream_rpc_method_handler(
servicer.ListUser,
request_deserializer=chat__room__pb2.Metadata.FromString,
response_serializer=chat__room__pb2.User.SerializeToString,
),
'SendMsg': grpc.stream_unary_rpc_method_handler(
servicer.SendMsg,
request_deserializer=chat__room__pb2.Message.FromString,
response_serializer=chat__room__pb2.Response.SerializeToString,
),
'ReceiveMsg': grpc.unary_stream_rpc_method_handler(
servicer.ReceiveMsg,
request_deserializer=chat__room__pb2.User.FromString,
response_serializer=chat__room__pb2.Message.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'chatroom.ChatRoom', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))