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