1
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
2
|
|
|
// versions: |
3
|
|
|
// - protoc-gen-go-grpc v1.4.0 |
4
|
|
|
// - protoc (unknown) |
5
|
|
|
// source: base/v1/health.proto |
6
|
|
|
|
7
|
|
|
package basev1 |
8
|
|
|
|
9
|
|
|
import ( |
10
|
|
|
context "context" |
11
|
|
|
grpc "google.golang.org/grpc" |
12
|
|
|
codes "google.golang.org/grpc/codes" |
13
|
|
|
status "google.golang.org/grpc/status" |
14
|
|
|
) |
15
|
|
|
|
16
|
|
|
// This is a compile-time assertion to ensure that this generated file |
17
|
|
|
// is compatible with the grpc package it is being compiled against. |
18
|
|
|
// Requires gRPC-Go v1.62.0 or later. |
19
|
|
|
const _ = grpc.SupportPackageIsVersion8 |
20
|
|
|
|
21
|
|
|
const ( |
22
|
|
|
Health_Check_FullMethodName = "/base.v1.Health/Check" |
23
|
|
|
Health_Watch_FullMethodName = "/base.v1.Health/Watch" |
24
|
|
|
) |
25
|
|
|
|
26
|
|
|
// HealthClient is the client API for Health service. |
27
|
|
|
// |
28
|
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. |
29
|
|
|
type HealthClient interface { |
30
|
|
|
// If the requested service is unknown, the call will fail with status |
31
|
|
|
// NOT_FOUND. |
32
|
|
|
Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) |
33
|
|
|
Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error) |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
type healthClient struct { |
37
|
|
|
cc grpc.ClientConnInterface |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
func NewHealthClient(cc grpc.ClientConnInterface) HealthClient { |
41
|
|
|
return &healthClient{cc} |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { |
45
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
46
|
|
|
out := new(HealthCheckResponse) |
47
|
|
|
err := c.cc.Invoke(ctx, Health_Check_FullMethodName, in, out, cOpts...) |
48
|
|
|
if err != nil { |
49
|
|
|
return nil, err |
50
|
|
|
} |
51
|
|
|
return out, nil |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error) { |
55
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
56
|
|
|
stream, err := c.cc.NewStream(ctx, &Health_ServiceDesc.Streams[0], Health_Watch_FullMethodName, cOpts...) |
57
|
|
|
if err != nil { |
58
|
|
|
return nil, err |
59
|
|
|
} |
60
|
|
|
x := &healthWatchClient{ClientStream: stream} |
61
|
|
|
if err := x.ClientStream.SendMsg(in); err != nil { |
62
|
|
|
return nil, err |
63
|
|
|
} |
64
|
|
|
if err := x.ClientStream.CloseSend(); err != nil { |
65
|
|
|
return nil, err |
66
|
|
|
} |
67
|
|
|
return x, nil |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
type Health_WatchClient interface { |
71
|
|
|
Recv() (*HealthCheckResponse, error) |
72
|
|
|
grpc.ClientStream |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
type healthWatchClient struct { |
76
|
|
|
grpc.ClientStream |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
func (x *healthWatchClient) Recv() (*HealthCheckResponse, error) { |
80
|
|
|
m := new(HealthCheckResponse) |
81
|
|
|
if err := x.ClientStream.RecvMsg(m); err != nil { |
82
|
|
|
return nil, err |
83
|
|
|
} |
84
|
|
|
return m, nil |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
// HealthServer is the server API for Health service. |
88
|
|
|
// All implementations must embed UnimplementedHealthServer |
89
|
|
|
// for forward compatibility |
90
|
|
|
type HealthServer interface { |
91
|
|
|
// If the requested service is unknown, the call will fail with status |
92
|
|
|
// NOT_FOUND. |
93
|
|
|
Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) |
94
|
|
|
Watch(*HealthCheckRequest, Health_WatchServer) error |
95
|
|
|
mustEmbedUnimplementedHealthServer() |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
// UnimplementedHealthServer must be embedded to have forward compatible implementations. |
99
|
|
|
type UnimplementedHealthServer struct { |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
func (UnimplementedHealthServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { |
103
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") |
104
|
|
|
} |
105
|
|
|
func (UnimplementedHealthServer) Watch(*HealthCheckRequest, Health_WatchServer) error { |
106
|
|
|
return status.Errorf(codes.Unimplemented, "method Watch not implemented") |
107
|
|
|
} |
108
|
|
|
func (UnimplementedHealthServer) mustEmbedUnimplementedHealthServer() {} |
109
|
|
|
|
110
|
|
|
// UnsafeHealthServer may be embedded to opt out of forward compatibility for this service. |
111
|
|
|
// Use of this interface is not recommended, as added methods to HealthServer will |
112
|
|
|
// result in compilation errors. |
113
|
|
|
type UnsafeHealthServer interface { |
114
|
|
|
mustEmbedUnimplementedHealthServer() |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer) { |
118
|
|
|
s.RegisterService(&Health_ServiceDesc, srv) |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
122
|
|
|
in := new(HealthCheckRequest) |
123
|
|
|
if err := dec(in); err != nil { |
124
|
|
|
return nil, err |
125
|
|
|
} |
126
|
|
|
if interceptor == nil { |
127
|
|
|
return srv.(HealthServer).Check(ctx, in) |
128
|
|
|
} |
129
|
|
|
info := &grpc.UnaryServerInfo{ |
130
|
|
|
Server: srv, |
131
|
|
|
FullMethod: Health_Check_FullMethodName, |
132
|
|
|
} |
133
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
134
|
|
|
return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest)) |
135
|
|
|
} |
136
|
|
|
return interceptor(ctx, in, info, handler) |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
func _Health_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { |
140
|
|
|
m := new(HealthCheckRequest) |
141
|
|
|
if err := stream.RecvMsg(m); err != nil { |
142
|
|
|
return err |
143
|
|
|
} |
144
|
|
|
return srv.(HealthServer).Watch(m, &healthWatchServer{ServerStream: stream}) |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
type Health_WatchServer interface { |
148
|
|
|
Send(*HealthCheckResponse) error |
149
|
|
|
grpc.ServerStream |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
type healthWatchServer struct { |
153
|
|
|
grpc.ServerStream |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
func (x *healthWatchServer) Send(m *HealthCheckResponse) error { |
157
|
|
|
return x.ServerStream.SendMsg(m) |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
// Health_ServiceDesc is the grpc.ServiceDesc for Health service. |
161
|
|
|
// It's only intended for direct use with grpc.RegisterService, |
162
|
|
|
// and not to be introspected or modified (even as a copy) |
163
|
|
|
var Health_ServiceDesc = grpc.ServiceDesc{ |
164
|
|
|
ServiceName: "base.v1.Health", |
165
|
|
|
HandlerType: (*HealthServer)(nil), |
166
|
|
|
Methods: []grpc.MethodDesc{ |
167
|
|
|
{ |
168
|
|
|
MethodName: "Check", |
169
|
|
|
Handler: _Health_Check_Handler, |
170
|
|
|
}, |
171
|
|
|
}, |
172
|
|
|
Streams: []grpc.StreamDesc{ |
173
|
|
|
{ |
174
|
|
|
StreamName: "Watch", |
175
|
|
|
Handler: _Health_Watch_Handler, |
176
|
|
|
ServerStreams: true, |
177
|
|
|
}, |
178
|
|
|
}, |
179
|
|
|
Metadata: "base/v1/health.proto", |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
|