mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 17:13:51 +00:00
355 lines
14 KiB
Python
355 lines
14 KiB
Python
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
"""Client and server classes corresponding to protobuf-defined services."""
|
|
import grpc
|
|
|
|
import bbgo_pb2 as bbgo__pb2
|
|
|
|
|
|
class MarketDataServiceStub(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
def __init__(self, channel):
|
|
"""Constructor.
|
|
|
|
Args:
|
|
channel: A grpc.Channel.
|
|
"""
|
|
self.Subscribe = channel.unary_stream(
|
|
'/bbgo.MarketDataService/Subscribe',
|
|
request_serializer=bbgo__pb2.SubscribeRequest.SerializeToString,
|
|
response_deserializer=bbgo__pb2.MarketData.FromString,
|
|
)
|
|
self.QueryKLines = channel.unary_unary(
|
|
'/bbgo.MarketDataService/QueryKLines',
|
|
request_serializer=bbgo__pb2.QueryKLinesRequest.SerializeToString,
|
|
response_deserializer=bbgo__pb2.QueryKLinesResponse.FromString,
|
|
)
|
|
|
|
|
|
class MarketDataServiceServicer(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
def Subscribe(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 QueryKLines(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 add_MarketDataServiceServicer_to_server(servicer, server):
|
|
rpc_method_handlers = {
|
|
'Subscribe': grpc.unary_stream_rpc_method_handler(
|
|
servicer.Subscribe,
|
|
request_deserializer=bbgo__pb2.SubscribeRequest.FromString,
|
|
response_serializer=bbgo__pb2.MarketData.SerializeToString,
|
|
),
|
|
'QueryKLines': grpc.unary_unary_rpc_method_handler(
|
|
servicer.QueryKLines,
|
|
request_deserializer=bbgo__pb2.QueryKLinesRequest.FromString,
|
|
response_serializer=bbgo__pb2.QueryKLinesResponse.SerializeToString,
|
|
),
|
|
}
|
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
'bbgo.MarketDataService', rpc_method_handlers)
|
|
server.add_generic_rpc_handlers((generic_handler,))
|
|
|
|
|
|
# This class is part of an EXPERIMENTAL API.
|
|
class MarketDataService(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
@staticmethod
|
|
def Subscribe(request,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.unary_stream(request, target, '/bbgo.MarketDataService/Subscribe',
|
|
bbgo__pb2.SubscribeRequest.SerializeToString,
|
|
bbgo__pb2.MarketData.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
|
|
@staticmethod
|
|
def QueryKLines(request,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.unary_unary(request, target, '/bbgo.MarketDataService/QueryKLines',
|
|
bbgo__pb2.QueryKLinesRequest.SerializeToString,
|
|
bbgo__pb2.QueryKLinesResponse.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
|
|
|
|
class UserDataServiceStub(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
def __init__(self, channel):
|
|
"""Constructor.
|
|
|
|
Args:
|
|
channel: A grpc.Channel.
|
|
"""
|
|
self.Subscribe = channel.unary_stream(
|
|
'/bbgo.UserDataService/Subscribe',
|
|
request_serializer=bbgo__pb2.UserDataRequest.SerializeToString,
|
|
response_deserializer=bbgo__pb2.UserData.FromString,
|
|
)
|
|
|
|
|
|
class UserDataServiceServicer(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
def Subscribe(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 add_UserDataServiceServicer_to_server(servicer, server):
|
|
rpc_method_handlers = {
|
|
'Subscribe': grpc.unary_stream_rpc_method_handler(
|
|
servicer.Subscribe,
|
|
request_deserializer=bbgo__pb2.UserDataRequest.FromString,
|
|
response_serializer=bbgo__pb2.UserData.SerializeToString,
|
|
),
|
|
}
|
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
'bbgo.UserDataService', rpc_method_handlers)
|
|
server.add_generic_rpc_handlers((generic_handler,))
|
|
|
|
|
|
# This class is part of an EXPERIMENTAL API.
|
|
class UserDataService(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
@staticmethod
|
|
def Subscribe(request,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.unary_stream(request, target, '/bbgo.UserDataService/Subscribe',
|
|
bbgo__pb2.UserDataRequest.SerializeToString,
|
|
bbgo__pb2.UserData.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
|
|
|
|
class TradingServiceStub(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
def __init__(self, channel):
|
|
"""Constructor.
|
|
|
|
Args:
|
|
channel: A grpc.Channel.
|
|
"""
|
|
self.SubmitOrder = channel.unary_unary(
|
|
'/bbgo.TradingService/SubmitOrder',
|
|
request_serializer=bbgo__pb2.SubmitOrderRequest.SerializeToString,
|
|
response_deserializer=bbgo__pb2.SubmitOrderResponse.FromString,
|
|
)
|
|
self.CancelOrder = channel.unary_unary(
|
|
'/bbgo.TradingService/CancelOrder',
|
|
request_serializer=bbgo__pb2.CancelOrderRequest.SerializeToString,
|
|
response_deserializer=bbgo__pb2.CancelOrderResponse.FromString,
|
|
)
|
|
self.QueryOrder = channel.unary_unary(
|
|
'/bbgo.TradingService/QueryOrder',
|
|
request_serializer=bbgo__pb2.QueryOrderRequest.SerializeToString,
|
|
response_deserializer=bbgo__pb2.QueryOrderResponse.FromString,
|
|
)
|
|
self.QueryOrders = channel.unary_unary(
|
|
'/bbgo.TradingService/QueryOrders',
|
|
request_serializer=bbgo__pb2.QueryOrdersRequest.SerializeToString,
|
|
response_deserializer=bbgo__pb2.QueryOrdersResponse.FromString,
|
|
)
|
|
self.QueryTrades = channel.unary_unary(
|
|
'/bbgo.TradingService/QueryTrades',
|
|
request_serializer=bbgo__pb2.QueryTradesRequest.SerializeToString,
|
|
response_deserializer=bbgo__pb2.QueryTradesResponse.FromString,
|
|
)
|
|
|
|
|
|
class TradingServiceServicer(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
def SubmitOrder(self, request, context):
|
|
"""request-response
|
|
"""
|
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
context.set_details('Method not implemented!')
|
|
raise NotImplementedError('Method not implemented!')
|
|
|
|
def CancelOrder(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 QueryOrder(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 QueryOrders(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 QueryTrades(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 add_TradingServiceServicer_to_server(servicer, server):
|
|
rpc_method_handlers = {
|
|
'SubmitOrder': grpc.unary_unary_rpc_method_handler(
|
|
servicer.SubmitOrder,
|
|
request_deserializer=bbgo__pb2.SubmitOrderRequest.FromString,
|
|
response_serializer=bbgo__pb2.SubmitOrderResponse.SerializeToString,
|
|
),
|
|
'CancelOrder': grpc.unary_unary_rpc_method_handler(
|
|
servicer.CancelOrder,
|
|
request_deserializer=bbgo__pb2.CancelOrderRequest.FromString,
|
|
response_serializer=bbgo__pb2.CancelOrderResponse.SerializeToString,
|
|
),
|
|
'QueryOrder': grpc.unary_unary_rpc_method_handler(
|
|
servicer.QueryOrder,
|
|
request_deserializer=bbgo__pb2.QueryOrderRequest.FromString,
|
|
response_serializer=bbgo__pb2.QueryOrderResponse.SerializeToString,
|
|
),
|
|
'QueryOrders': grpc.unary_unary_rpc_method_handler(
|
|
servicer.QueryOrders,
|
|
request_deserializer=bbgo__pb2.QueryOrdersRequest.FromString,
|
|
response_serializer=bbgo__pb2.QueryOrdersResponse.SerializeToString,
|
|
),
|
|
'QueryTrades': grpc.unary_unary_rpc_method_handler(
|
|
servicer.QueryTrades,
|
|
request_deserializer=bbgo__pb2.QueryTradesRequest.FromString,
|
|
response_serializer=bbgo__pb2.QueryTradesResponse.SerializeToString,
|
|
),
|
|
}
|
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
'bbgo.TradingService', rpc_method_handlers)
|
|
server.add_generic_rpc_handlers((generic_handler,))
|
|
|
|
|
|
# This class is part of an EXPERIMENTAL API.
|
|
class TradingService(object):
|
|
"""Missing associated documentation comment in .proto file."""
|
|
|
|
@staticmethod
|
|
def SubmitOrder(request,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.unary_unary(request, target, '/bbgo.TradingService/SubmitOrder',
|
|
bbgo__pb2.SubmitOrderRequest.SerializeToString,
|
|
bbgo__pb2.SubmitOrderResponse.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
|
|
@staticmethod
|
|
def CancelOrder(request,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.unary_unary(request, target, '/bbgo.TradingService/CancelOrder',
|
|
bbgo__pb2.CancelOrderRequest.SerializeToString,
|
|
bbgo__pb2.CancelOrderResponse.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
|
|
@staticmethod
|
|
def QueryOrder(request,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.unary_unary(request, target, '/bbgo.TradingService/QueryOrder',
|
|
bbgo__pb2.QueryOrderRequest.SerializeToString,
|
|
bbgo__pb2.QueryOrderResponse.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
|
|
@staticmethod
|
|
def QueryOrders(request,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.unary_unary(request, target, '/bbgo.TradingService/QueryOrders',
|
|
bbgo__pb2.QueryOrdersRequest.SerializeToString,
|
|
bbgo__pb2.QueryOrdersResponse.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
|
|
@staticmethod
|
|
def QueryTrades(request,
|
|
target,
|
|
options=(),
|
|
channel_credentials=None,
|
|
call_credentials=None,
|
|
insecure=False,
|
|
compression=None,
|
|
wait_for_ready=None,
|
|
timeout=None,
|
|
metadata=None):
|
|
return grpc.experimental.unary_unary(request, target, '/bbgo.TradingService/QueryTrades',
|
|
bbgo__pb2.QueryTradesRequest.SerializeToString,
|
|
bbgo__pb2.QueryTradesResponse.FromString,
|
|
options, channel_credentials,
|
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|