service_pb2_grpc.py 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
  2. import grpc
  3. import proto.service_pb2 as service__pb2
  4. class CallerStub(object):
  5. """Missing associated documentation comment in .proto file"""
  6. def __init__(self, channel):
  7. """Constructor.
  8. Args:
  9. channel: A grpc.Channel.
  10. """
  11. self.Call = channel.unary_unary(
  12. '/main.Caller/Call',
  13. request_serializer=service__pb2.Request.SerializeToString,
  14. response_deserializer=service__pb2.Response.FromString,
  15. )
  16. self.ViewState = channel.unary_unary(
  17. '/main.Caller/ViewState',
  18. request_serializer=service__pb2.Empty.SerializeToString,
  19. response_deserializer=service__pb2.State.FromString,
  20. )
  21. class CallerServicer(object):
  22. """Missing associated documentation comment in .proto file"""
  23. def Call(self, request, context):
  24. """远程调用
  25. """
  26. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  27. context.set_details('Method not implemented!')
  28. raise NotImplementedError('Method not implemented!')
  29. def ViewState(self, request, context):
  30. """状态查看
  31. """
  32. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  33. context.set_details('Method not implemented!')
  34. raise NotImplementedError('Method not implemented!')
  35. def add_CallerServicer_to_server(servicer, server):
  36. rpc_method_handlers = {
  37. 'Call': grpc.unary_unary_rpc_method_handler(
  38. servicer.Call,
  39. request_deserializer=service__pb2.Request.FromString,
  40. response_serializer=service__pb2.Response.SerializeToString,
  41. ),
  42. 'ViewState': grpc.unary_unary_rpc_method_handler(
  43. servicer.ViewState,
  44. request_deserializer=service__pb2.Empty.FromString,
  45. response_serializer=service__pb2.State.SerializeToString,
  46. ),
  47. }
  48. generic_handler = grpc.method_handlers_generic_handler(
  49. 'main.Caller', rpc_method_handlers)
  50. server.add_generic_rpc_handlers((generic_handler,))
  51. # This class is part of an EXPERIMENTAL API.
  52. class Caller(object):
  53. """Missing associated documentation comment in .proto file"""
  54. @staticmethod
  55. def Call(request,
  56. target,
  57. options=(),
  58. channel_credentials=None,
  59. call_credentials=None,
  60. compression=None,
  61. wait_for_ready=None,
  62. timeout=None,
  63. metadata=None):
  64. return grpc.experimental.unary_unary(request, target, '/main.Caller/Call',
  65. service__pb2.Request.SerializeToString,
  66. service__pb2.Response.FromString,
  67. options, channel_credentials,
  68. call_credentials, compression, wait_for_ready, timeout, metadata)
  69. @staticmethod
  70. def ViewState(request,
  71. target,
  72. options=(),
  73. channel_credentials=None,
  74. call_credentials=None,
  75. compression=None,
  76. wait_for_ready=None,
  77. timeout=None,
  78. metadata=None):
  79. return grpc.experimental.unary_unary(request, target, '/main.Caller/ViewState',
  80. service__pb2.Empty.SerializeToString,
  81. service__pb2.State.FromString,
  82. options, channel_credentials,
  83. call_credentials, compression, wait_for_ready, timeout, metadata)