Debian Codegraph @

envoy/service/discovery/v2/hds_grpc.pb.go

raw
1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2 // versions:
3 // - protoc-gen-go-grpc v1.3.0
4 // - protoc v5.29.1
5 // source: envoy/service/discovery/v2/hds.proto
6
7 package discoveryv2
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.32.0 or later.
19 const _ = grpc.SupportPackageIsVersion7
20
21 const (
22 HealthDiscoveryService_StreamHealthCheck_FullMethodName = "/envoy.service.discovery.v2.HealthDiscoveryService/StreamHealthCheck"
23 HealthDiscoveryService_FetchHealthCheck_FullMethodName = "/envoy.service.discovery.v2.HealthDiscoveryService/FetchHealthCheck"
24 )
25
26 // HealthDiscoveryServiceClient is the client API for HealthDiscoveryService 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 HealthDiscoveryServiceClient interface {
30 // 1. Envoy starts up and if its can_healthcheck option in the static
31 // bootstrap config is enabled, sends HealthCheckRequest to the management
32 // server. It supplies its capabilities (which protocol it can health check
33 // with, what zone it resides in, etc.).
34 // 2. In response to (1), the management server designates this Envoy as a
35 // healthchecker to health check a subset of all upstream hosts for a given
36 // cluster (for example upstream Host 1 and Host 2). It streams
37 // HealthCheckSpecifier messages with cluster related configuration for all
38 // clusters this Envoy is designated to health check. Subsequent
39 // HealthCheckSpecifier message will be sent on changes to:
40 // a. Endpoints to health checks
41 // b. Per cluster configuration change
42 // 3. Envoy creates a health probe based on the HealthCheck config and sends
43 // it to endpoint(ip:port) of Host 1 and 2. Based on the HealthCheck
44 // configuration Envoy waits upon the arrival of the probe response and
45 // looks at the content of the response to decide whether the endpoint is
46 // healthy or not. If a response hasn't been received within the timeout
47 // interval, the endpoint health status is considered TIMEOUT.
48 // 4. Envoy reports results back in an EndpointHealthResponse message.
49 // Envoy streams responses as often as the interval configured by the
50 // management server in HealthCheckSpecifier.
51 // 5. The management Server collects health statuses for all endpoints in the
52 // cluster (for all clusters) and uses this information to construct
53 // EndpointDiscoveryResponse messages.
54 // 6. Once Envoy has a list of upstream endpoints to send traffic to, it load
55 // balances traffic to them without additional health checking. It may
56 // use inline healthcheck (i.e. consider endpoint UNHEALTHY if connection
57 // failed to a particular endpoint to account for health status propagation
58 // delay between HDS and EDS).
59 //
60 // By default, can_healthcheck is true. If can_healthcheck is false, Cluster
61 // configuration may not contain HealthCheck message.
62 // TODO(htuch): How is can_healthcheck communicated to CDS to ensure the above
63 // invariant?
64 // TODO(htuch): Add @amb67's diagram.
65 StreamHealthCheck(ctx context.Context, opts ...grpc.CallOption) (HealthDiscoveryService_StreamHealthCheckClient, error)
66 // TODO(htuch): Unlike the gRPC version, there is no stream-based binding of
67 // request/response. Should we add an identifier to the HealthCheckSpecifier
68 // to bind with the response?
69 FetchHealthCheck(ctx context.Context, in *HealthCheckRequestOrEndpointHealthResponse, opts ...grpc.CallOption) (*HealthCheckSpecifier, error)
70 }
71
72 type healthDiscoveryServiceClient struct {
73 cc grpc.ClientConnInterface
74 }
75
76 func NewHealthDiscoveryServiceClient(cc grpc.ClientConnInterface) HealthDiscoveryServiceClient {
77 return &healthDiscoveryServiceClient{cc}
78 }
79
80 func (c *healthDiscoveryServiceClient) StreamHealthCheck(ctx context.Context, opts ...grpc.CallOption) (HealthDiscoveryService_StreamHealthCheckClient, error) {
81 stream, err := c.cc.NewStream(ctx, &HealthDiscoveryService_ServiceDesc.Streams[0], HealthDiscoveryService_StreamHealthCheck_FullMethodName, opts...)
82 if err != nil {
83 return nil, err
84 }
85 x := &healthDiscoveryServiceStreamHealthCheckClient{stream}
86 return x, nil
87 }
88
89 type HealthDiscoveryService_StreamHealthCheckClient interface {
90 Send(*HealthCheckRequestOrEndpointHealthResponse) error
91 Recv() (*HealthCheckSpecifier, error)
92 grpc.ClientStream
93 }
94
95 type healthDiscoveryServiceStreamHealthCheckClient struct {
96 grpc.ClientStream
97 }
98
99 func (x *healthDiscoveryServiceStreamHealthCheckClient) Send(m *HealthCheckRequestOrEndpointHealthResponse) error {
100 return x.ClientStream.SendMsg(m)
101 }
102
103 func (x *healthDiscoveryServiceStreamHealthCheckClient) Recv() (*HealthCheckSpecifier, error) {
104 m := new(HealthCheckSpecifier)
105 if err := x.ClientStream.RecvMsg(m); err != nil {
106 return nil, err
107 }
108 return m, nil
109 }
110
111 func (c *healthDiscoveryServiceClient) FetchHealthCheck(ctx context.Context, in *HealthCheckRequestOrEndpointHealthResponse, opts ...grpc.CallOption) (*HealthCheckSpecifier, error) {
112 out := new(HealthCheckSpecifier)
113 err := c.cc.Invoke(ctx, HealthDiscoveryService_FetchHealthCheck_FullMethodName, in, out, opts...)
114 if err != nil {
115 return nil, err
116 }
117 return out, nil
118 }
119
120 // HealthDiscoveryServiceServer is the server API for HealthDiscoveryService service.
121 // All implementations should embed UnimplementedHealthDiscoveryServiceServer
122 // for forward compatibility
123 type HealthDiscoveryServiceServer interface {
124 // 1. Envoy starts up and if its can_healthcheck option in the static
125 // bootstrap config is enabled, sends HealthCheckRequest to the management
126 // server. It supplies its capabilities (which protocol it can health check
127 // with, what zone it resides in, etc.).
128 // 2. In response to (1), the management server designates this Envoy as a
129 // healthchecker to health check a subset of all upstream hosts for a given
130 // cluster (for example upstream Host 1 and Host 2). It streams
131 // HealthCheckSpecifier messages with cluster related configuration for all
132 // clusters this Envoy is designated to health check. Subsequent
133 // HealthCheckSpecifier message will be sent on changes to:
134 // a. Endpoints to health checks
135 // b. Per cluster configuration change
136 // 3. Envoy creates a health probe based on the HealthCheck config and sends
137 // it to endpoint(ip:port) of Host 1 and 2. Based on the HealthCheck
138 // configuration Envoy waits upon the arrival of the probe response and
139 // looks at the content of the response to decide whether the endpoint is
140 // healthy or not. If a response hasn't been received within the timeout
141 // interval, the endpoint health status is considered TIMEOUT.
142 // 4. Envoy reports results back in an EndpointHealthResponse message.
143 // Envoy streams responses as often as the interval configured by the
144 // management server in HealthCheckSpecifier.
145 // 5. The management Server collects health statuses for all endpoints in the
146 // cluster (for all clusters) and uses this information to construct
147 // EndpointDiscoveryResponse messages.
148 // 6. Once Envoy has a list of upstream endpoints to send traffic to, it load
149 // balances traffic to them without additional health checking. It may
150 // use inline healthcheck (i.e. consider endpoint UNHEALTHY if connection
151 // failed to a particular endpoint to account for health status propagation
152 // delay between HDS and EDS).
153 //
154 // By default, can_healthcheck is true. If can_healthcheck is false, Cluster
155 // configuration may not contain HealthCheck message.
156 // TODO(htuch): How is can_healthcheck communicated to CDS to ensure the above
157 // invariant?
158 // TODO(htuch): Add @amb67's diagram.
159 StreamHealthCheck(HealthDiscoveryService_StreamHealthCheckServer) error
160 // TODO(htuch): Unlike the gRPC version, there is no stream-based binding of
161 // request/response. Should we add an identifier to the HealthCheckSpecifier
162 // to bind with the response?
163 FetchHealthCheck(context.Context, *HealthCheckRequestOrEndpointHealthResponse) (*HealthCheckSpecifier, error)
164 }
165
166 // UnimplementedHealthDiscoveryServiceServer should be embedded to have forward compatible implementations.
167 type UnimplementedHealthDiscoveryServiceServer struct {
168 }
169
170 func (UnimplementedHealthDiscoveryServiceServer) StreamHealthCheck(HealthDiscoveryService_StreamHealthCheckServer) error {
171 return status.Errorf(codes.Unimplemented, "method StreamHealthCheck not implemented")
172 }
173 func (UnimplementedHealthDiscoveryServiceServer) FetchHealthCheck(context.Context, *HealthCheckRequestOrEndpointHealthResponse) (*HealthCheckSpecifier, error) {
174 return nil, status.Errorf(codes.Unimplemented, "method FetchHealthCheck not implemented")
175 }
176
177 // UnsafeHealthDiscoveryServiceServer may be embedded to opt out of forward compatibility for this service.
178 // Use of this interface is not recommended, as added methods to HealthDiscoveryServiceServer will
179 // result in compilation errors.
180 type UnsafeHealthDiscoveryServiceServer interface {
181 mustEmbedUnimplementedHealthDiscoveryServiceServer()
182 }
183
184 func RegisterHealthDiscoveryServiceServer(s grpc.ServiceRegistrar, srv HealthDiscoveryServiceServer) {
185 s.RegisterService(&HealthDiscoveryService_ServiceDesc, srv)
186 }
187
188 func _HealthDiscoveryService_StreamHealthCheck_Handler(srv interface{}, stream grpc.ServerStream) error {
189 return srv.(HealthDiscoveryServiceServer).StreamHealthCheck(&healthDiscoveryServiceStreamHealthCheckServer{stream})
190 }
191
192 type HealthDiscoveryService_StreamHealthCheckServer interface {
193 Send(*HealthCheckSpecifier) error
194 Recv() (*HealthCheckRequestOrEndpointHealthResponse, error)
195 grpc.ServerStream
196 }
197
198 type healthDiscoveryServiceStreamHealthCheckServer struct {
199 grpc.ServerStream
200 }
201
202 func (x *healthDiscoveryServiceStreamHealthCheckServer) Send(m *HealthCheckSpecifier) error {
203 return x.ServerStream.SendMsg(m)
204 }
205
206 func (x *healthDiscoveryServiceStreamHealthCheckServer) Recv() (*HealthCheckRequestOrEndpointHealthResponse, error) {
207 m := new(HealthCheckRequestOrEndpointHealthResponse)
208 if err := x.ServerStream.RecvMsg(m); err != nil {
209 return nil, err
210 }
211 return m, nil
212 }
213
214 func _HealthDiscoveryService_FetchHealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
215 in := new(HealthCheckRequestOrEndpointHealthResponse)
216 if err := dec(in); err != nil {
217 return nil, err
218 }
219 if interceptor == nil {
220 return srv.(HealthDiscoveryServiceServer).FetchHealthCheck(ctx, in)
221 }
222 info := &grpc.UnaryServerInfo{
223 Server: srv,
224 FullMethod: HealthDiscoveryService_FetchHealthCheck_FullMethodName,
225 }
226 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
227 return srv.(HealthDiscoveryServiceServer).FetchHealthCheck(ctx, req.(*HealthCheckRequestOrEndpointHealthResponse))
228 }
229 return interceptor(ctx, in, info, handler)
230 }
231
232 // HealthDiscoveryService_ServiceDesc is the grpc.ServiceDesc for HealthDiscoveryService service.
233 // It's only intended for direct use with grpc.RegisterService,
234 // and not to be introspected or modified (even as a copy)
235 var HealthDiscoveryService_ServiceDesc = grpc.ServiceDesc{
236 ServiceName: "envoy.service.discovery.v2.HealthDiscoveryService",
237 HandlerType: (*HealthDiscoveryServiceServer)(nil),
238 Methods: []grpc.MethodDesc{
239 {
240 MethodName: "FetchHealthCheck",
241 Handler: _HealthDiscoveryService_FetchHealthCheck_Handler,
242 },
243 },
244 Streams: []grpc.StreamDesc{
245 {
246 StreamName: "StreamHealthCheck",
247 Handler: _HealthDiscoveryService_StreamHealthCheck_Handler,
248 ServerStreams: true,
249 ClientStreams: true,
250 },
251 },
252 Metadata: "envoy/service/discovery/v2/hds.proto",
253 }