Add 'car/' from commit 'eee0e8dc445691e600680f4abc77f2814b20b054'

git-subtree-dir: car
git-subtree-mainline: 1d29a5526c
git-subtree-split: eee0e8dc44
This commit is contained in:
Piv
2020-04-19 11:07:44 +09:30
93 changed files with 8401 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import MyRaft.raft_pb2 as raft__pb2
class RaftStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.AppendEntriesRPC = channel.unary_unary(
'/raft.Raft/AppendEntriesRPC',
request_serializer=raft__pb2.AppendEntries.SerializeToString,
response_deserializer=raft__pb2.AppendEntriesResponse.FromString,
)
self.RequestVoteRPC = channel.unary_unary(
'/raft.Raft/RequestVoteRPC',
request_serializer=raft__pb2.RequestVote.SerializeToString,
response_deserializer=raft__pb2.RequestVoteResponse.FromString,
)
class RaftServicer(object):
# missing associated documentation comment in .proto file
pass
def AppendEntriesRPC(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 RequestVoteRPC(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_RaftServicer_to_server(servicer, server):
rpc_method_handlers = {
'AppendEntriesRPC': grpc.unary_unary_rpc_method_handler(
servicer.AppendEntriesRPC,
request_deserializer=raft__pb2.AppendEntries.FromString,
response_serializer=raft__pb2.AppendEntriesResponse.SerializeToString,
),
'RequestVoteRPC': grpc.unary_unary_rpc_method_handler(
servicer.RequestVoteRPC,
request_deserializer=raft__pb2.RequestVote.FromString,
response_serializer=raft__pb2.RequestVoteResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'raft.Raft', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))