health_grpc.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Generated by the Protocol Buffers compiler. DO NOT EDIT!
  2. # source: grpc_m/health/health.proto
  3. # plugin: grpclib.plugin.main
  4. import abc
  5. import typing
  6. import grpclib.const
  7. import grpclib.client
  8. if typing.TYPE_CHECKING:
  9. import grpclib.server
  10. import grpc_m.health.health_pb2
  11. class HealthBase(abc.ABC):
  12. @abc.abstractmethod
  13. async def Check(self, stream: 'grpclib.server.Stream[grpc_m.health.health_pb2.HealthCheckRequest, grpc_m.health.health_pb2.HealthCheckResponse]') -> None:
  14. pass
  15. @abc.abstractmethod
  16. async def Watch(self, stream: 'grpclib.server.Stream[grpc_m.health.health_pb2.HealthCheckRequest, grpc_m.health.health_pb2.HealthCheckResponse]') -> None:
  17. pass
  18. def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
  19. return {
  20. '/grpc.health.v1.Health/Check': grpclib.const.Handler(
  21. self.Check,
  22. grpclib.const.Cardinality.UNARY_UNARY,
  23. grpc_m.health.health_pb2.HealthCheckRequest,
  24. grpc_m.health.health_pb2.HealthCheckResponse,
  25. ),
  26. '/grpc.health.v1.Health/Watch': grpclib.const.Handler(
  27. self.Watch,
  28. grpclib.const.Cardinality.UNARY_STREAM,
  29. grpc_m.health.health_pb2.HealthCheckRequest,
  30. grpc_m.health.health_pb2.HealthCheckResponse,
  31. ),
  32. }
  33. class HealthStub:
  34. def __init__(self, channel: grpclib.client.Channel) -> None:
  35. self.Check = grpclib.client.UnaryUnaryMethod(
  36. channel,
  37. '/grpc.health.v1.Health/Check',
  38. grpc_m.health.health_pb2.HealthCheckRequest,
  39. grpc_m.health.health_pb2.HealthCheckResponse,
  40. )
  41. self.Watch = grpclib.client.UnaryStreamMethod(
  42. channel,
  43. '/grpc.health.v1.Health/Watch',
  44. grpc_m.health.health_pb2.HealthCheckRequest,
  45. grpc_m.health.health_pb2.HealthCheckResponse,
  46. )