health.pb.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: grpc/health/v1/health.proto
  3. package grpc_health_v1 // import "google.golang.org/grpc/health/grpc_health_v1"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import (
  8. context "golang.org/x/net/context"
  9. grpc "google.golang.org/grpc"
  10. )
  11. // Reference imports to suppress errors if they are not otherwise used.
  12. var _ = proto.Marshal
  13. var _ = fmt.Errorf
  14. var _ = math.Inf
  15. // This is a compile-time assertion to ensure that this generated file
  16. // is compatible with the proto package it is being compiled against.
  17. // A compilation error at this line likely means your copy of the
  18. // proto package needs to be updated.
  19. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  20. type HealthCheckResponse_ServingStatus int32
  21. const (
  22. HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0
  23. HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1
  24. HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2
  25. HealthCheckResponse_SERVICE_UNKNOWN HealthCheckResponse_ServingStatus = 3
  26. )
  27. var HealthCheckResponse_ServingStatus_name = map[int32]string{
  28. 0: "UNKNOWN",
  29. 1: "SERVING",
  30. 2: "NOT_SERVING",
  31. 3: "SERVICE_UNKNOWN",
  32. }
  33. var HealthCheckResponse_ServingStatus_value = map[string]int32{
  34. "UNKNOWN": 0,
  35. "SERVING": 1,
  36. "NOT_SERVING": 2,
  37. "SERVICE_UNKNOWN": 3,
  38. }
  39. func (x HealthCheckResponse_ServingStatus) String() string {
  40. return proto.EnumName(HealthCheckResponse_ServingStatus_name, int32(x))
  41. }
  42. func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) {
  43. return fileDescriptor_health_6b1a06aa67f91efd, []int{1, 0}
  44. }
  45. type HealthCheckRequest struct {
  46. Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
  47. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  48. XXX_unrecognized []byte `json:"-"`
  49. XXX_sizecache int32 `json:"-"`
  50. }
  51. func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} }
  52. func (m *HealthCheckRequest) String() string { return proto.CompactTextString(m) }
  53. func (*HealthCheckRequest) ProtoMessage() {}
  54. func (*HealthCheckRequest) Descriptor() ([]byte, []int) {
  55. return fileDescriptor_health_6b1a06aa67f91efd, []int{0}
  56. }
  57. func (m *HealthCheckRequest) XXX_Unmarshal(b []byte) error {
  58. return xxx_messageInfo_HealthCheckRequest.Unmarshal(m, b)
  59. }
  60. func (m *HealthCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  61. return xxx_messageInfo_HealthCheckRequest.Marshal(b, m, deterministic)
  62. }
  63. func (dst *HealthCheckRequest) XXX_Merge(src proto.Message) {
  64. xxx_messageInfo_HealthCheckRequest.Merge(dst, src)
  65. }
  66. func (m *HealthCheckRequest) XXX_Size() int {
  67. return xxx_messageInfo_HealthCheckRequest.Size(m)
  68. }
  69. func (m *HealthCheckRequest) XXX_DiscardUnknown() {
  70. xxx_messageInfo_HealthCheckRequest.DiscardUnknown(m)
  71. }
  72. var xxx_messageInfo_HealthCheckRequest proto.InternalMessageInfo
  73. func (m *HealthCheckRequest) GetService() string {
  74. if m != nil {
  75. return m.Service
  76. }
  77. return ""
  78. }
  79. type HealthCheckResponse struct {
  80. Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=grpc.health.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"`
  81. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  82. XXX_unrecognized []byte `json:"-"`
  83. XXX_sizecache int32 `json:"-"`
  84. }
  85. func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} }
  86. func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) }
  87. func (*HealthCheckResponse) ProtoMessage() {}
  88. func (*HealthCheckResponse) Descriptor() ([]byte, []int) {
  89. return fileDescriptor_health_6b1a06aa67f91efd, []int{1}
  90. }
  91. func (m *HealthCheckResponse) XXX_Unmarshal(b []byte) error {
  92. return xxx_messageInfo_HealthCheckResponse.Unmarshal(m, b)
  93. }
  94. func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  95. return xxx_messageInfo_HealthCheckResponse.Marshal(b, m, deterministic)
  96. }
  97. func (dst *HealthCheckResponse) XXX_Merge(src proto.Message) {
  98. xxx_messageInfo_HealthCheckResponse.Merge(dst, src)
  99. }
  100. func (m *HealthCheckResponse) XXX_Size() int {
  101. return xxx_messageInfo_HealthCheckResponse.Size(m)
  102. }
  103. func (m *HealthCheckResponse) XXX_DiscardUnknown() {
  104. xxx_messageInfo_HealthCheckResponse.DiscardUnknown(m)
  105. }
  106. var xxx_messageInfo_HealthCheckResponse proto.InternalMessageInfo
  107. func (m *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus {
  108. if m != nil {
  109. return m.Status
  110. }
  111. return HealthCheckResponse_UNKNOWN
  112. }
  113. func init() {
  114. proto.RegisterType((*HealthCheckRequest)(nil), "grpc.health.v1.HealthCheckRequest")
  115. proto.RegisterType((*HealthCheckResponse)(nil), "grpc.health.v1.HealthCheckResponse")
  116. proto.RegisterEnum("grpc.health.v1.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value)
  117. }
  118. // Reference imports to suppress errors if they are not otherwise used.
  119. var _ context.Context
  120. var _ grpc.ClientConn
  121. // This is a compile-time assertion to ensure that this generated file
  122. // is compatible with the grpc package it is being compiled against.
  123. const _ = grpc.SupportPackageIsVersion4
  124. // HealthClient is the client API for Health service.
  125. //
  126. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  127. type HealthClient interface {
  128. // If the requested service is unknown, the call will fail with status
  129. // NOT_FOUND.
  130. Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
  131. // Performs a watch for the serving status of the requested service.
  132. // The server will immediately send back a message indicating the current
  133. // serving status. It will then subsequently send a new message whenever
  134. // the service's serving status changes.
  135. //
  136. // If the requested service is unknown when the call is received, the
  137. // server will send a message setting the serving status to
  138. // SERVICE_UNKNOWN but will *not* terminate the call. If at some
  139. // future point, the serving status of the service becomes known, the
  140. // server will send a new message with the service's serving status.
  141. //
  142. // If the call terminates with status UNIMPLEMENTED, then clients
  143. // should assume this method is not supported and should not retry the
  144. // call. If the call terminates with any other status (including OK),
  145. // clients should retry the call with appropriate exponential backoff.
  146. Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error)
  147. }
  148. type healthClient struct {
  149. cc *grpc.ClientConn
  150. }
  151. func NewHealthClient(cc *grpc.ClientConn) HealthClient {
  152. return &healthClient{cc}
  153. }
  154. func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
  155. out := new(HealthCheckResponse)
  156. err := c.cc.Invoke(ctx, "/grpc.health.v1.Health/Check", in, out, opts...)
  157. if err != nil {
  158. return nil, err
  159. }
  160. return out, nil
  161. }
  162. func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error) {
  163. stream, err := c.cc.NewStream(ctx, &_Health_serviceDesc.Streams[0], "/grpc.health.v1.Health/Watch", opts...)
  164. if err != nil {
  165. return nil, err
  166. }
  167. x := &healthWatchClient{stream}
  168. if err := x.ClientStream.SendMsg(in); err != nil {
  169. return nil, err
  170. }
  171. if err := x.ClientStream.CloseSend(); err != nil {
  172. return nil, err
  173. }
  174. return x, nil
  175. }
  176. type Health_WatchClient interface {
  177. Recv() (*HealthCheckResponse, error)
  178. grpc.ClientStream
  179. }
  180. type healthWatchClient struct {
  181. grpc.ClientStream
  182. }
  183. func (x *healthWatchClient) Recv() (*HealthCheckResponse, error) {
  184. m := new(HealthCheckResponse)
  185. if err := x.ClientStream.RecvMsg(m); err != nil {
  186. return nil, err
  187. }
  188. return m, nil
  189. }
  190. // HealthServer is the server API for Health service.
  191. type HealthServer interface {
  192. // If the requested service is unknown, the call will fail with status
  193. // NOT_FOUND.
  194. Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
  195. // Performs a watch for the serving status of the requested service.
  196. // The server will immediately send back a message indicating the current
  197. // serving status. It will then subsequently send a new message whenever
  198. // the service's serving status changes.
  199. //
  200. // If the requested service is unknown when the call is received, the
  201. // server will send a message setting the serving status to
  202. // SERVICE_UNKNOWN but will *not* terminate the call. If at some
  203. // future point, the serving status of the service becomes known, the
  204. // server will send a new message with the service's serving status.
  205. //
  206. // If the call terminates with status UNIMPLEMENTED, then clients
  207. // should assume this method is not supported and should not retry the
  208. // call. If the call terminates with any other status (including OK),
  209. // clients should retry the call with appropriate exponential backoff.
  210. Watch(*HealthCheckRequest, Health_WatchServer) error
  211. }
  212. func RegisterHealthServer(s *grpc.Server, srv HealthServer) {
  213. s.RegisterService(&_Health_serviceDesc, srv)
  214. }
  215. func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  216. in := new(HealthCheckRequest)
  217. if err := dec(in); err != nil {
  218. return nil, err
  219. }
  220. if interceptor == nil {
  221. return srv.(HealthServer).Check(ctx, in)
  222. }
  223. info := &grpc.UnaryServerInfo{
  224. Server: srv,
  225. FullMethod: "/grpc.health.v1.Health/Check",
  226. }
  227. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  228. return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest))
  229. }
  230. return interceptor(ctx, in, info, handler)
  231. }
  232. func _Health_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
  233. m := new(HealthCheckRequest)
  234. if err := stream.RecvMsg(m); err != nil {
  235. return err
  236. }
  237. return srv.(HealthServer).Watch(m, &healthWatchServer{stream})
  238. }
  239. type Health_WatchServer interface {
  240. Send(*HealthCheckResponse) error
  241. grpc.ServerStream
  242. }
  243. type healthWatchServer struct {
  244. grpc.ServerStream
  245. }
  246. func (x *healthWatchServer) Send(m *HealthCheckResponse) error {
  247. return x.ServerStream.SendMsg(m)
  248. }
  249. var _Health_serviceDesc = grpc.ServiceDesc{
  250. ServiceName: "grpc.health.v1.Health",
  251. HandlerType: (*HealthServer)(nil),
  252. Methods: []grpc.MethodDesc{
  253. {
  254. MethodName: "Check",
  255. Handler: _Health_Check_Handler,
  256. },
  257. },
  258. Streams: []grpc.StreamDesc{
  259. {
  260. StreamName: "Watch",
  261. Handler: _Health_Watch_Handler,
  262. ServerStreams: true,
  263. },
  264. },
  265. Metadata: "grpc/health/v1/health.proto",
  266. }
  267. func init() { proto.RegisterFile("grpc/health/v1/health.proto", fileDescriptor_health_6b1a06aa67f91efd) }
  268. var fileDescriptor_health_6b1a06aa67f91efd = []byte{
  269. // 297 bytes of a gzipped FileDescriptorProto
  270. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0x2f, 0x2a, 0x48,
  271. 0xd6, 0xcf, 0x48, 0x4d, 0xcc, 0x29, 0xc9, 0xd0, 0x2f, 0x33, 0x84, 0xb2, 0xf4, 0x0a, 0x8a, 0xf2,
  272. 0x4b, 0xf2, 0x85, 0xf8, 0x40, 0x92, 0x7a, 0x50, 0xa1, 0x32, 0x43, 0x25, 0x3d, 0x2e, 0x21, 0x0f,
  273. 0x30, 0xc7, 0x39, 0x23, 0x35, 0x39, 0x3b, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x48, 0x82,
  274. 0x8b, 0xbd, 0x38, 0xb5, 0xa8, 0x2c, 0x33, 0x39, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08,
  275. 0xc6, 0x55, 0xda, 0xc8, 0xc8, 0x25, 0x8c, 0xa2, 0xa1, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x55, 0xc8,
  276. 0x93, 0x8b, 0xad, 0xb8, 0x24, 0xb1, 0xa4, 0xb4, 0x18, 0xac, 0x81, 0xcf, 0xc8, 0x50, 0x0f, 0xd5,
  277. 0x22, 0x3d, 0x2c, 0x9a, 0xf4, 0x82, 0x41, 0x86, 0xe6, 0xa5, 0x07, 0x83, 0x35, 0x06, 0x41, 0x0d,
  278. 0x50, 0xf2, 0xe7, 0xe2, 0x45, 0x91, 0x10, 0xe2, 0xe6, 0x62, 0x0f, 0xf5, 0xf3, 0xf6, 0xf3, 0x0f,
  279. 0xf7, 0x13, 0x60, 0x00, 0x71, 0x82, 0x5d, 0x83, 0xc2, 0x3c, 0xfd, 0xdc, 0x05, 0x18, 0x85, 0xf8,
  280. 0xb9, 0xb8, 0xfd, 0xfc, 0x43, 0xe2, 0x61, 0x02, 0x4c, 0x42, 0xc2, 0x5c, 0xfc, 0x60, 0x8e, 0xb3,
  281. 0x6b, 0x3c, 0x4c, 0x0b, 0xb3, 0xd1, 0x3a, 0x46, 0x2e, 0x36, 0x88, 0xf5, 0x42, 0x01, 0x5c, 0xac,
  282. 0x60, 0x27, 0x08, 0x29, 0xe1, 0x75, 0x1f, 0x38, 0x14, 0xa4, 0x94, 0x89, 0xf0, 0x83, 0x50, 0x10,
  283. 0x17, 0x6b, 0x78, 0x62, 0x49, 0x72, 0x06, 0xd5, 0x4c, 0x34, 0x60, 0x74, 0x4a, 0xe4, 0x12, 0xcc,
  284. 0xcc, 0x47, 0x53, 0xea, 0xc4, 0x0d, 0x51, 0x1b, 0x00, 0x8a, 0xc6, 0x00, 0xc6, 0x28, 0x9d, 0xf4,
  285. 0xfc, 0xfc, 0xf4, 0x9c, 0x54, 0xbd, 0xf4, 0xfc, 0x9c, 0xc4, 0xbc, 0x74, 0xbd, 0xfc, 0xa2, 0x74,
  286. 0x7d, 0xe4, 0x78, 0x07, 0xb1, 0xe3, 0x21, 0xec, 0xf8, 0x32, 0xc3, 0x55, 0x4c, 0x7c, 0xee, 0x20,
  287. 0xd3, 0x20, 0x46, 0xe8, 0x85, 0x19, 0x26, 0xb1, 0x81, 0x93, 0x83, 0x31, 0x20, 0x00, 0x00, 0xff,
  288. 0xff, 0x12, 0x7d, 0x96, 0xcb, 0x2d, 0x02, 0x00, 0x00,
  289. }