| 1 |
// Copyright 2015-2016 gRPC authors. |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
// An integration test service that covers all the method signature permutations |
| 16 |
// of unary/streaming requests/responses. |
| 17 |
|
| 18 |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| 19 |
// versions: |
| 20 |
// - protoc-gen-go-grpc v1.5.1 |
| 21 |
// - protoc v4.25.6 |
| 22 |
// source: grpc/testing/test.proto |
| 23 |
|
| 24 |
package test |
| 25 |
|
| 26 |
import ( |
| 27 |
context "context" |
| 28 |
empty "continuous_load_testing/proto/grpc/testing/empty" |
| 29 |
messages "continuous_load_testing/proto/grpc/testing/messages" |
| 30 |
grpc "google.golang.org/grpc" |
| 31 |
codes "google.golang.org/grpc/codes" |
| 32 |
status "google.golang.org/grpc/status" |
| 33 |
) |
| 34 |
|
| 35 |
// This is a compile-time assertion to ensure that this generated file |
| 36 |
// is compatible with the grpc package it is being compiled against. |
| 37 |
// Requires gRPC-Go v1.64.0 or later. |
| 38 |
const _ = grpc.SupportPackageIsVersion9 |
| 39 |
|
| 40 |
const ( |
| 41 |
TestService_EmptyCall_FullMethodName = "/grpc.testing.TestService/EmptyCall" |
| 42 |
TestService_UnaryCall_FullMethodName = "/grpc.testing.TestService/UnaryCall" |
| 43 |
TestService_CacheableUnaryCall_FullMethodName = "/grpc.testing.TestService/CacheableUnaryCall" |
| 44 |
TestService_StreamingOutputCall_FullMethodName = "/grpc.testing.TestService/StreamingOutputCall" |
| 45 |
TestService_StreamingInputCall_FullMethodName = "/grpc.testing.TestService/StreamingInputCall" |
| 46 |
TestService_FullDuplexCall_FullMethodName = "/grpc.testing.TestService/FullDuplexCall" |
| 47 |
TestService_HalfDuplexCall_FullMethodName = "/grpc.testing.TestService/HalfDuplexCall" |
| 48 |
TestService_UnimplementedCall_FullMethodName = "/grpc.testing.TestService/UnimplementedCall" |
| 49 |
) |
| 50 |
|
| 51 |
// TestServiceClient is the client API for TestService service. |
| 52 |
// |
| 53 |
// 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. |
| 54 |
// |
| 55 |
// A simple service to test the various types of RPCs and experiment with |
| 56 |
// performance with various types of payload. |
| 57 |
type TestServiceClient interface { |
| 58 |
// One empty request followed by one empty response. |
| 59 |
EmptyCall(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) |
| 60 |
// One request followed by one response. |
| 61 |
UnaryCall(ctx context.Context, in *messages.SimpleRequest, opts ...grpc.CallOption) (*messages.SimpleResponse, error) |
| 62 |
// One request followed by one response. Response has cache control |
| 63 |
// headers set such that a caching HTTP proxy (such as GFE) can |
| 64 |
// satisfy subsequent requests. |
| 65 |
CacheableUnaryCall(ctx context.Context, in *messages.SimpleRequest, opts ...grpc.CallOption) (*messages.SimpleResponse, error) |
| 66 |
// One request followed by a sequence of responses (streamed download). |
| 67 |
// The server returns the payload with client desired type and sizes. |
| 68 |
StreamingOutputCall(ctx context.Context, in *messages.StreamingOutputCallRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[messages.StreamingOutputCallResponse], error) |
| 69 |
// A sequence of requests followed by one response (streamed upload). |
| 70 |
// The server returns the aggregated size of client payload as the result. |
| 71 |
StreamingInputCall(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[messages.StreamingInputCallRequest, messages.StreamingInputCallResponse], error) |
| 72 |
// A sequence of requests with each request served by the server immediately. |
| 73 |
// As one request could lead to multiple responses, this interface |
| 74 |
// demonstrates the idea of full duplexing. |
| 75 |
FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse], error) |
| 76 |
// A sequence of requests followed by a sequence of responses. |
| 77 |
// The server buffers all the client requests and then serves them in order. A |
| 78 |
// stream of responses are returned to the client when the server starts with |
| 79 |
// first request. |
| 80 |
HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse], error) |
| 81 |
// The test server will not implement this method. It will be used |
| 82 |
// to test the behavior when clients call unimplemented methods. |
| 83 |
UnimplementedCall(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) |
| 84 |
} |
| 85 |
|
| 86 |
type testServiceClient struct { |
| 87 |
cc grpc.ClientConnInterface |
| 88 |
} |
| 89 |
|
| 90 |
func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient { |
| 91 |
return &testServiceClient{cc} |
| 92 |
} |
| 93 |
|
| 94 |
func (c *testServiceClient) EmptyCall(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { |
| 95 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 96 |
out := new(empty.Empty) |
| 97 |
err := c.cc.Invoke(ctx, TestService_EmptyCall_FullMethodName, in, out, cOpts...) |
| 98 |
if err != nil { |
| 99 |
return nil, err |
| 100 |
} |
| 101 |
return out, nil |
| 102 |
} |
| 103 |
|
| 104 |
func (c *testServiceClient) UnaryCall(ctx context.Context, in *messages.SimpleRequest, opts ...grpc.CallOption) (*messages.SimpleResponse, error) { |
| 105 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 106 |
out := new(messages.SimpleResponse) |
| 107 |
err := c.cc.Invoke(ctx, TestService_UnaryCall_FullMethodName, in, out, cOpts...) |
| 108 |
if err != nil { |
| 109 |
return nil, err |
| 110 |
} |
| 111 |
return out, nil |
| 112 |
} |
| 113 |
|
| 114 |
func (c *testServiceClient) CacheableUnaryCall(ctx context.Context, in *messages.SimpleRequest, opts ...grpc.CallOption) (*messages.SimpleResponse, error) { |
| 115 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 116 |
out := new(messages.SimpleResponse) |
| 117 |
err := c.cc.Invoke(ctx, TestService_CacheableUnaryCall_FullMethodName, in, out, cOpts...) |
| 118 |
if err != nil { |
| 119 |
return nil, err |
| 120 |
} |
| 121 |
return out, nil |
| 122 |
} |
| 123 |
|
| 124 |
func (c *testServiceClient) StreamingOutputCall(ctx context.Context, in *messages.StreamingOutputCallRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[messages.StreamingOutputCallResponse], error) { |
| 125 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 126 |
stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[0], TestService_StreamingOutputCall_FullMethodName, cOpts...) |
| 127 |
if err != nil { |
| 128 |
return nil, err |
| 129 |
} |
| 130 |
x := &grpc.GenericClientStream[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse]{ClientStream: stream} |
| 131 |
if err := x.ClientStream.SendMsg(in); err != nil { |
| 132 |
return nil, err |
| 133 |
} |
| 134 |
if err := x.ClientStream.CloseSend(); err != nil { |
| 135 |
return nil, err |
| 136 |
} |
| 137 |
return x, nil |
| 138 |
} |
| 139 |
|
| 140 |
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
| 141 |
type TestService_StreamingOutputCallClient = grpc.ServerStreamingClient[messages.StreamingOutputCallResponse] |
| 142 |
|
| 143 |
func (c *testServiceClient) StreamingInputCall(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[messages.StreamingInputCallRequest, messages.StreamingInputCallResponse], error) { |
| 144 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 145 |
stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[1], TestService_StreamingInputCall_FullMethodName, cOpts...) |
| 146 |
if err != nil { |
| 147 |
return nil, err |
| 148 |
} |
| 149 |
x := &grpc.GenericClientStream[messages.StreamingInputCallRequest, messages.StreamingInputCallResponse]{ClientStream: stream} |
| 150 |
return x, nil |
| 151 |
} |
| 152 |
|
| 153 |
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
| 154 |
type TestService_StreamingInputCallClient = grpc.ClientStreamingClient[messages.StreamingInputCallRequest, messages.StreamingInputCallResponse] |
| 155 |
|
| 156 |
func (c *testServiceClient) FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse], error) { |
| 157 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 158 |
stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[2], TestService_FullDuplexCall_FullMethodName, cOpts...) |
| 159 |
if err != nil { |
| 160 |
return nil, err |
| 161 |
} |
| 162 |
x := &grpc.GenericClientStream[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse]{ClientStream: stream} |
| 163 |
return x, nil |
| 164 |
} |
| 165 |
|
| 166 |
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
| 167 |
type TestService_FullDuplexCallClient = grpc.BidiStreamingClient[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse] |
| 168 |
|
| 169 |
func (c *testServiceClient) HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse], error) { |
| 170 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 171 |
stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[3], TestService_HalfDuplexCall_FullMethodName, cOpts...) |
| 172 |
if err != nil { |
| 173 |
return nil, err |
| 174 |
} |
| 175 |
x := &grpc.GenericClientStream[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse]{ClientStream: stream} |
| 176 |
return x, nil |
| 177 |
} |
| 178 |
|
| 179 |
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
| 180 |
type TestService_HalfDuplexCallClient = grpc.BidiStreamingClient[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse] |
| 181 |
|
| 182 |
func (c *testServiceClient) UnimplementedCall(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { |
| 183 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 184 |
out := new(empty.Empty) |
| 185 |
err := c.cc.Invoke(ctx, TestService_UnimplementedCall_FullMethodName, in, out, cOpts...) |
| 186 |
if err != nil { |
| 187 |
return nil, err |
| 188 |
} |
| 189 |
return out, nil |
| 190 |
} |
| 191 |
|
| 192 |
// TestServiceServer is the server API for TestService service. |
| 193 |
// All implementations must embed UnimplementedTestServiceServer |
| 194 |
// for forward compatibility. |
| 195 |
// |
| 196 |
// A simple service to test the various types of RPCs and experiment with |
| 197 |
// performance with various types of payload. |
| 198 |
type TestServiceServer interface { |
| 199 |
// One empty request followed by one empty response. |
| 200 |
EmptyCall(context.Context, *empty.Empty) (*empty.Empty, error) |
| 201 |
// One request followed by one response. |
| 202 |
UnaryCall(context.Context, *messages.SimpleRequest) (*messages.SimpleResponse, error) |
| 203 |
// One request followed by one response. Response has cache control |
| 204 |
// headers set such that a caching HTTP proxy (such as GFE) can |
| 205 |
// satisfy subsequent requests. |
| 206 |
CacheableUnaryCall(context.Context, *messages.SimpleRequest) (*messages.SimpleResponse, error) |
| 207 |
// One request followed by a sequence of responses (streamed download). |
| 208 |
// The server returns the payload with client desired type and sizes. |
| 209 |
StreamingOutputCall(*messages.StreamingOutputCallRequest, grpc.ServerStreamingServer[messages.StreamingOutputCallResponse]) error |
| 210 |
// A sequence of requests followed by one response (streamed upload). |
| 211 |
// The server returns the aggregated size of client payload as the result. |
| 212 |
StreamingInputCall(grpc.ClientStreamingServer[messages.StreamingInputCallRequest, messages.StreamingInputCallResponse]) error |
| 213 |
// A sequence of requests with each request served by the server immediately. |
| 214 |
// As one request could lead to multiple responses, this interface |
| 215 |
// demonstrates the idea of full duplexing. |
| 216 |
FullDuplexCall(grpc.BidiStreamingServer[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse]) error |
| 217 |
// A sequence of requests followed by a sequence of responses. |
| 218 |
// The server buffers all the client requests and then serves them in order. A |
| 219 |
// stream of responses are returned to the client when the server starts with |
| 220 |
// first request. |
| 221 |
HalfDuplexCall(grpc.BidiStreamingServer[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse]) error |
| 222 |
// The test server will not implement this method. It will be used |
| 223 |
// to test the behavior when clients call unimplemented methods. |
| 224 |
UnimplementedCall(context.Context, *empty.Empty) (*empty.Empty, error) |
| 225 |
mustEmbedUnimplementedTestServiceServer() |
| 226 |
} |
| 227 |
|
| 228 |
// UnimplementedTestServiceServer must be embedded to have |
| 229 |
// forward compatible implementations. |
| 230 |
// |
| 231 |
// NOTE: this should be embedded by value instead of pointer to avoid a nil |
| 232 |
// pointer dereference when methods are called. |
| 233 |
type UnimplementedTestServiceServer struct{} |
| 234 |
|
| 235 |
func (UnimplementedTestServiceServer) EmptyCall(context.Context, *empty.Empty) (*empty.Empty, error) { |
| 236 |
return nil, status.Errorf(codes.Unimplemented, "method EmptyCall not implemented") |
| 237 |
} |
| 238 |
func (UnimplementedTestServiceServer) UnaryCall(context.Context, *messages.SimpleRequest) (*messages.SimpleResponse, error) { |
| 239 |
return nil, status.Errorf(codes.Unimplemented, "method UnaryCall not implemented") |
| 240 |
} |
| 241 |
func (UnimplementedTestServiceServer) CacheableUnaryCall(context.Context, *messages.SimpleRequest) (*messages.SimpleResponse, error) { |
| 242 |
return nil, status.Errorf(codes.Unimplemented, "method CacheableUnaryCall not implemented") |
| 243 |
} |
| 244 |
func (UnimplementedTestServiceServer) StreamingOutputCall(*messages.StreamingOutputCallRequest, grpc.ServerStreamingServer[messages.StreamingOutputCallResponse]) error { |
| 245 |
return status.Errorf(codes.Unimplemented, "method StreamingOutputCall not implemented") |
| 246 |
} |
| 247 |
func (UnimplementedTestServiceServer) StreamingInputCall(grpc.ClientStreamingServer[messages.StreamingInputCallRequest, messages.StreamingInputCallResponse]) error { |
| 248 |
return status.Errorf(codes.Unimplemented, "method StreamingInputCall not implemented") |
| 249 |
} |
| 250 |
func (UnimplementedTestServiceServer) FullDuplexCall(grpc.BidiStreamingServer[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse]) error { |
| 251 |
return status.Errorf(codes.Unimplemented, "method FullDuplexCall not implemented") |
| 252 |
} |
| 253 |
func (UnimplementedTestServiceServer) HalfDuplexCall(grpc.BidiStreamingServer[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse]) error { |
| 254 |
return status.Errorf(codes.Unimplemented, "method HalfDuplexCall not implemented") |
| 255 |
} |
| 256 |
func (UnimplementedTestServiceServer) UnimplementedCall(context.Context, *empty.Empty) (*empty.Empty, error) { |
| 257 |
return nil, status.Errorf(codes.Unimplemented, "method UnimplementedCall not implemented") |
| 258 |
} |
| 259 |
func (UnimplementedTestServiceServer) mustEmbedUnimplementedTestServiceServer() {} |
| 260 |
func (UnimplementedTestServiceServer) testEmbeddedByValue() {} |
| 261 |
|
| 262 |
// UnsafeTestServiceServer may be embedded to opt out of forward compatibility for this service. |
| 263 |
// Use of this interface is not recommended, as added methods to TestServiceServer will |
| 264 |
// result in compilation errors. |
| 265 |
type UnsafeTestServiceServer interface { |
| 266 |
mustEmbedUnimplementedTestServiceServer() |
| 267 |
} |
| 268 |
|
| 269 |
func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer) { |
| 270 |
// If the following call pancis, it indicates UnimplementedTestServiceServer was |
| 271 |
// embedded by pointer and is nil. This will cause panics if an |
| 272 |
// unimplemented method is ever invoked, so we test this at initialization |
| 273 |
// time to prevent it from happening at runtime later due to I/O. |
| 274 |
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { |
| 275 |
t.testEmbeddedByValue() |
| 276 |
} |
| 277 |
s.RegisterService(&TestService_ServiceDesc, srv) |
| 278 |
} |
| 279 |
|
| 280 |
func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 281 |
in := new(empty.Empty) |
| 282 |
if err := dec(in); err != nil { |
| 283 |
return nil, err |
| 284 |
} |
| 285 |
if interceptor == nil { |
| 286 |
return srv.(TestServiceServer).EmptyCall(ctx, in) |
| 287 |
} |
| 288 |
info := &grpc.UnaryServerInfo{ |
| 289 |
Server: srv, |
| 290 |
FullMethod: TestService_EmptyCall_FullMethodName, |
| 291 |
} |
| 292 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 293 |
return srv.(TestServiceServer).EmptyCall(ctx, req.(*empty.Empty)) |
| 294 |
} |
| 295 |
return interceptor(ctx, in, info, handler) |
| 296 |
} |
| 297 |
|
| 298 |
func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 299 |
in := new(messages.SimpleRequest) |
| 300 |
if err := dec(in); err != nil { |
| 301 |
return nil, err |
| 302 |
} |
| 303 |
if interceptor == nil { |
| 304 |
return srv.(TestServiceServer).UnaryCall(ctx, in) |
| 305 |
} |
| 306 |
info := &grpc.UnaryServerInfo{ |
| 307 |
Server: srv, |
| 308 |
FullMethod: TestService_UnaryCall_FullMethodName, |
| 309 |
} |
| 310 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 311 |
return srv.(TestServiceServer).UnaryCall(ctx, req.(*messages.SimpleRequest)) |
| 312 |
} |
| 313 |
return interceptor(ctx, in, info, handler) |
| 314 |
} |
| 315 |
|
| 316 |
func _TestService_CacheableUnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 317 |
in := new(messages.SimpleRequest) |
| 318 |
if err := dec(in); err != nil { |
| 319 |
return nil, err |
| 320 |
} |
| 321 |
if interceptor == nil { |
| 322 |
return srv.(TestServiceServer).CacheableUnaryCall(ctx, in) |
| 323 |
} |
| 324 |
info := &grpc.UnaryServerInfo{ |
| 325 |
Server: srv, |
| 326 |
FullMethod: TestService_CacheableUnaryCall_FullMethodName, |
| 327 |
} |
| 328 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 329 |
return srv.(TestServiceServer).CacheableUnaryCall(ctx, req.(*messages.SimpleRequest)) |
| 330 |
} |
| 331 |
return interceptor(ctx, in, info, handler) |
| 332 |
} |
| 333 |
|
| 334 |
func _TestService_StreamingOutputCall_Handler(srv interface{}, stream grpc.ServerStream) error { |
| 335 |
m := new(messages.StreamingOutputCallRequest) |
| 336 |
if err := stream.RecvMsg(m); err != nil { |
| 337 |
return err |
| 338 |
} |
| 339 |
return srv.(TestServiceServer).StreamingOutputCall(m, &grpc.GenericServerStream[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse]{ServerStream: stream}) |
| 340 |
} |
| 341 |
|
| 342 |
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
| 343 |
type TestService_StreamingOutputCallServer = grpc.ServerStreamingServer[messages.StreamingOutputCallResponse] |
| 344 |
|
| 345 |
func _TestService_StreamingInputCall_Handler(srv interface{}, stream grpc.ServerStream) error { |
| 346 |
return srv.(TestServiceServer).StreamingInputCall(&grpc.GenericServerStream[messages.StreamingInputCallRequest, messages.StreamingInputCallResponse]{ServerStream: stream}) |
| 347 |
} |
| 348 |
|
| 349 |
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
| 350 |
type TestService_StreamingInputCallServer = grpc.ClientStreamingServer[messages.StreamingInputCallRequest, messages.StreamingInputCallResponse] |
| 351 |
|
| 352 |
func _TestService_FullDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { |
| 353 |
return srv.(TestServiceServer).FullDuplexCall(&grpc.GenericServerStream[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse]{ServerStream: stream}) |
| 354 |
} |
| 355 |
|
| 356 |
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
| 357 |
type TestService_FullDuplexCallServer = grpc.BidiStreamingServer[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse] |
| 358 |
|
| 359 |
func _TestService_HalfDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { |
| 360 |
return srv.(TestServiceServer).HalfDuplexCall(&grpc.GenericServerStream[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse]{ServerStream: stream}) |
| 361 |
} |
| 362 |
|
| 363 |
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. |
| 364 |
type TestService_HalfDuplexCallServer = grpc.BidiStreamingServer[messages.StreamingOutputCallRequest, messages.StreamingOutputCallResponse] |
| 365 |
|
| 366 |
func _TestService_UnimplementedCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 367 |
in := new(empty.Empty) |
| 368 |
if err := dec(in); err != nil { |
| 369 |
return nil, err |
| 370 |
} |
| 371 |
if interceptor == nil { |
| 372 |
return srv.(TestServiceServer).UnimplementedCall(ctx, in) |
| 373 |
} |
| 374 |
info := &grpc.UnaryServerInfo{ |
| 375 |
Server: srv, |
| 376 |
FullMethod: TestService_UnimplementedCall_FullMethodName, |
| 377 |
} |
| 378 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 379 |
return srv.(TestServiceServer).UnimplementedCall(ctx, req.(*empty.Empty)) |
| 380 |
} |
| 381 |
return interceptor(ctx, in, info, handler) |
| 382 |
} |
| 383 |
|
| 384 |
// TestService_ServiceDesc is the grpc.ServiceDesc for TestService service. |
| 385 |
// It's only intended for direct use with grpc.RegisterService, |
| 386 |
// and not to be introspected or modified (even as a copy) |
| 387 |
var TestService_ServiceDesc = grpc.ServiceDesc{ |
| 388 |
ServiceName: "grpc.testing.TestService", |
| 389 |
HandlerType: (*TestServiceServer)(nil), |
| 390 |
Methods: []grpc.MethodDesc{ |
| 391 |
{ |
| 392 |
MethodName: "EmptyCall", |
| 393 |
Handler: _TestService_EmptyCall_Handler, |
| 394 |
}, |
| 395 |
{ |
| 396 |
MethodName: "UnaryCall", |
| 397 |
Handler: _TestService_UnaryCall_Handler, |
| 398 |
}, |
| 399 |
{ |
| 400 |
MethodName: "CacheableUnaryCall", |
| 401 |
Handler: _TestService_CacheableUnaryCall_Handler, |
| 402 |
}, |
| 403 |
{ |
| 404 |
MethodName: "UnimplementedCall", |
| 405 |
Handler: _TestService_UnimplementedCall_Handler, |
| 406 |
}, |
| 407 |
}, |
| 408 |
Streams: []grpc.StreamDesc{ |
| 409 |
{ |
| 410 |
StreamName: "StreamingOutputCall", |
| 411 |
Handler: _TestService_StreamingOutputCall_Handler, |
| 412 |
ServerStreams: true, |
| 413 |
}, |
| 414 |
{ |
| 415 |
StreamName: "StreamingInputCall", |
| 416 |
Handler: _TestService_StreamingInputCall_Handler, |
| 417 |
ClientStreams: true, |
| 418 |
}, |
| 419 |
{ |
| 420 |
StreamName: "FullDuplexCall", |
| 421 |
Handler: _TestService_FullDuplexCall_Handler, |
| 422 |
ServerStreams: true, |
| 423 |
ClientStreams: true, |
| 424 |
}, |
| 425 |
{ |
| 426 |
StreamName: "HalfDuplexCall", |
| 427 |
Handler: _TestService_HalfDuplexCall_Handler, |
| 428 |
ServerStreams: true, |
| 429 |
ClientStreams: true, |
| 430 |
}, |
| 431 |
}, |
| 432 |
Metadata: "grpc/testing/test.proto", |
| 433 |
} |
| 434 |
|
| 435 |
const ( |
| 436 |
UnimplementedService_UnimplementedCall_FullMethodName = "/grpc.testing.UnimplementedService/UnimplementedCall" |
| 437 |
) |
| 438 |
|
| 439 |
// UnimplementedServiceClient is the client API for UnimplementedService service. |
| 440 |
// |
| 441 |
// 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. |
| 442 |
// |
| 443 |
// A simple service NOT implemented at servers so clients can test for |
| 444 |
// that case. |
| 445 |
type UnimplementedServiceClient interface { |
| 446 |
// A call that no server should implement |
| 447 |
UnimplementedCall(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) |
| 448 |
} |
| 449 |
|
| 450 |
type unimplementedServiceClient struct { |
| 451 |
cc grpc.ClientConnInterface |
| 452 |
} |
| 453 |
|
| 454 |
func NewUnimplementedServiceClient(cc grpc.ClientConnInterface) UnimplementedServiceClient { |
| 455 |
return &unimplementedServiceClient{cc} |
| 456 |
} |
| 457 |
|
| 458 |
func (c *unimplementedServiceClient) UnimplementedCall(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { |
| 459 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 460 |
out := new(empty.Empty) |
| 461 |
err := c.cc.Invoke(ctx, UnimplementedService_UnimplementedCall_FullMethodName, in, out, cOpts...) |
| 462 |
if err != nil { |
| 463 |
return nil, err |
| 464 |
} |
| 465 |
return out, nil |
| 466 |
} |
| 467 |
|
| 468 |
// UnimplementedServiceServer is the server API for UnimplementedService service. |
| 469 |
// All implementations must embed UnimplementedUnimplementedServiceServer |
| 470 |
// for forward compatibility. |
| 471 |
// |
| 472 |
// A simple service NOT implemented at servers so clients can test for |
| 473 |
// that case. |
| 474 |
type UnimplementedServiceServer interface { |
| 475 |
// A call that no server should implement |
| 476 |
UnimplementedCall(context.Context, *empty.Empty) (*empty.Empty, error) |
| 477 |
mustEmbedUnimplementedUnimplementedServiceServer() |
| 478 |
} |
| 479 |
|
| 480 |
// UnimplementedUnimplementedServiceServer must be embedded to have |
| 481 |
// forward compatible implementations. |
| 482 |
// |
| 483 |
// NOTE: this should be embedded by value instead of pointer to avoid a nil |
| 484 |
// pointer dereference when methods are called. |
| 485 |
type UnimplementedUnimplementedServiceServer struct{} |
| 486 |
|
| 487 |
func (UnimplementedUnimplementedServiceServer) UnimplementedCall(context.Context, *empty.Empty) (*empty.Empty, error) { |
| 488 |
return nil, status.Errorf(codes.Unimplemented, "method UnimplementedCall not implemented") |
| 489 |
} |
| 490 |
func (UnimplementedUnimplementedServiceServer) mustEmbedUnimplementedUnimplementedServiceServer() {} |
| 491 |
func (UnimplementedUnimplementedServiceServer) testEmbeddedByValue() {} |
| 492 |
|
| 493 |
// UnsafeUnimplementedServiceServer may be embedded to opt out of forward compatibility for this service. |
| 494 |
// Use of this interface is not recommended, as added methods to UnimplementedServiceServer will |
| 495 |
// result in compilation errors. |
| 496 |
type UnsafeUnimplementedServiceServer interface { |
| 497 |
mustEmbedUnimplementedUnimplementedServiceServer() |
| 498 |
} |
| 499 |
|
| 500 |
func RegisterUnimplementedServiceServer(s grpc.ServiceRegistrar, srv UnimplementedServiceServer) { |
| 501 |
// If the following call pancis, it indicates UnimplementedUnimplementedServiceServer was |
| 502 |
// embedded by pointer and is nil. This will cause panics if an |
| 503 |
// unimplemented method is ever invoked, so we test this at initialization |
| 504 |
// time to prevent it from happening at runtime later due to I/O. |
| 505 |
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { |
| 506 |
t.testEmbeddedByValue() |
| 507 |
} |
| 508 |
s.RegisterService(&UnimplementedService_ServiceDesc, srv) |
| 509 |
} |
| 510 |
|
| 511 |
func _UnimplementedService_UnimplementedCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 512 |
in := new(empty.Empty) |
| 513 |
if err := dec(in); err != nil { |
| 514 |
return nil, err |
| 515 |
} |
| 516 |
if interceptor == nil { |
| 517 |
return srv.(UnimplementedServiceServer).UnimplementedCall(ctx, in) |
| 518 |
} |
| 519 |
info := &grpc.UnaryServerInfo{ |
| 520 |
Server: srv, |
| 521 |
FullMethod: UnimplementedService_UnimplementedCall_FullMethodName, |
| 522 |
} |
| 523 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 524 |
return srv.(UnimplementedServiceServer).UnimplementedCall(ctx, req.(*empty.Empty)) |
| 525 |
} |
| 526 |
return interceptor(ctx, in, info, handler) |
| 527 |
} |
| 528 |
|
| 529 |
// UnimplementedService_ServiceDesc is the grpc.ServiceDesc for UnimplementedService service. |
| 530 |
// It's only intended for direct use with grpc.RegisterService, |
| 531 |
// and not to be introspected or modified (even as a copy) |
| 532 |
var UnimplementedService_ServiceDesc = grpc.ServiceDesc{ |
| 533 |
ServiceName: "grpc.testing.UnimplementedService", |
| 534 |
HandlerType: (*UnimplementedServiceServer)(nil), |
| 535 |
Methods: []grpc.MethodDesc{ |
| 536 |
{ |
| 537 |
MethodName: "UnimplementedCall", |
| 538 |
Handler: _UnimplementedService_UnimplementedCall_Handler, |
| 539 |
}, |
| 540 |
}, |
| 541 |
Streams: []grpc.StreamDesc{}, |
| 542 |
Metadata: "grpc/testing/test.proto", |
| 543 |
} |
| 544 |
|
| 545 |
const ( |
| 546 |
ReconnectService_Start_FullMethodName = "/grpc.testing.ReconnectService/Start" |
| 547 |
ReconnectService_Stop_FullMethodName = "/grpc.testing.ReconnectService/Stop" |
| 548 |
) |
| 549 |
|
| 550 |
// ReconnectServiceClient is the client API for ReconnectService service. |
| 551 |
// |
| 552 |
// 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. |
| 553 |
// |
| 554 |
// A service used to control reconnect server. |
| 555 |
type ReconnectServiceClient interface { |
| 556 |
Start(ctx context.Context, in *messages.ReconnectParams, opts ...grpc.CallOption) (*empty.Empty, error) |
| 557 |
Stop(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*messages.ReconnectInfo, error) |
| 558 |
} |
| 559 |
|
| 560 |
type reconnectServiceClient struct { |
| 561 |
cc grpc.ClientConnInterface |
| 562 |
} |
| 563 |
|
| 564 |
func NewReconnectServiceClient(cc grpc.ClientConnInterface) ReconnectServiceClient { |
| 565 |
return &reconnectServiceClient{cc} |
| 566 |
} |
| 567 |
|
| 568 |
func (c *reconnectServiceClient) Start(ctx context.Context, in *messages.ReconnectParams, opts ...grpc.CallOption) (*empty.Empty, error) { |
| 569 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 570 |
out := new(empty.Empty) |
| 571 |
err := c.cc.Invoke(ctx, ReconnectService_Start_FullMethodName, in, out, cOpts...) |
| 572 |
if err != nil { |
| 573 |
return nil, err |
| 574 |
} |
| 575 |
return out, nil |
| 576 |
} |
| 577 |
|
| 578 |
func (c *reconnectServiceClient) Stop(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*messages.ReconnectInfo, error) { |
| 579 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 580 |
out := new(messages.ReconnectInfo) |
| 581 |
err := c.cc.Invoke(ctx, ReconnectService_Stop_FullMethodName, in, out, cOpts...) |
| 582 |
if err != nil { |
| 583 |
return nil, err |
| 584 |
} |
| 585 |
return out, nil |
| 586 |
} |
| 587 |
|
| 588 |
// ReconnectServiceServer is the server API for ReconnectService service. |
| 589 |
// All implementations must embed UnimplementedReconnectServiceServer |
| 590 |
// for forward compatibility. |
| 591 |
// |
| 592 |
// A service used to control reconnect server. |
| 593 |
type ReconnectServiceServer interface { |
| 594 |
Start(context.Context, *messages.ReconnectParams) (*empty.Empty, error) |
| 595 |
Stop(context.Context, *empty.Empty) (*messages.ReconnectInfo, error) |
| 596 |
mustEmbedUnimplementedReconnectServiceServer() |
| 597 |
} |
| 598 |
|
| 599 |
// UnimplementedReconnectServiceServer must be embedded to have |
| 600 |
// forward compatible implementations. |
| 601 |
// |
| 602 |
// NOTE: this should be embedded by value instead of pointer to avoid a nil |
| 603 |
// pointer dereference when methods are called. |
| 604 |
type UnimplementedReconnectServiceServer struct{} |
| 605 |
|
| 606 |
func (UnimplementedReconnectServiceServer) Start(context.Context, *messages.ReconnectParams) (*empty.Empty, error) { |
| 607 |
return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") |
| 608 |
} |
| 609 |
func (UnimplementedReconnectServiceServer) Stop(context.Context, *empty.Empty) (*messages.ReconnectInfo, error) { |
| 610 |
return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") |
| 611 |
} |
| 612 |
func (UnimplementedReconnectServiceServer) mustEmbedUnimplementedReconnectServiceServer() {} |
| 613 |
func (UnimplementedReconnectServiceServer) testEmbeddedByValue() {} |
| 614 |
|
| 615 |
// UnsafeReconnectServiceServer may be embedded to opt out of forward compatibility for this service. |
| 616 |
// Use of this interface is not recommended, as added methods to ReconnectServiceServer will |
| 617 |
// result in compilation errors. |
| 618 |
type UnsafeReconnectServiceServer interface { |
| 619 |
mustEmbedUnimplementedReconnectServiceServer() |
| 620 |
} |
| 621 |
|
| 622 |
func RegisterReconnectServiceServer(s grpc.ServiceRegistrar, srv ReconnectServiceServer) { |
| 623 |
// If the following call pancis, it indicates UnimplementedReconnectServiceServer was |
| 624 |
// embedded by pointer and is nil. This will cause panics if an |
| 625 |
// unimplemented method is ever invoked, so we test this at initialization |
| 626 |
// time to prevent it from happening at runtime later due to I/O. |
| 627 |
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { |
| 628 |
t.testEmbeddedByValue() |
| 629 |
} |
| 630 |
s.RegisterService(&ReconnectService_ServiceDesc, srv) |
| 631 |
} |
| 632 |
|
| 633 |
func _ReconnectService_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 634 |
in := new(messages.ReconnectParams) |
| 635 |
if err := dec(in); err != nil { |
| 636 |
return nil, err |
| 637 |
} |
| 638 |
if interceptor == nil { |
| 639 |
return srv.(ReconnectServiceServer).Start(ctx, in) |
| 640 |
} |
| 641 |
info := &grpc.UnaryServerInfo{ |
| 642 |
Server: srv, |
| 643 |
FullMethod: ReconnectService_Start_FullMethodName, |
| 644 |
} |
| 645 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 646 |
return srv.(ReconnectServiceServer).Start(ctx, req.(*messages.ReconnectParams)) |
| 647 |
} |
| 648 |
return interceptor(ctx, in, info, handler) |
| 649 |
} |
| 650 |
|
| 651 |
func _ReconnectService_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 652 |
in := new(empty.Empty) |
| 653 |
if err := dec(in); err != nil { |
| 654 |
return nil, err |
| 655 |
} |
| 656 |
if interceptor == nil { |
| 657 |
return srv.(ReconnectServiceServer).Stop(ctx, in) |
| 658 |
} |
| 659 |
info := &grpc.UnaryServerInfo{ |
| 660 |
Server: srv, |
| 661 |
FullMethod: ReconnectService_Stop_FullMethodName, |
| 662 |
} |
| 663 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 664 |
return srv.(ReconnectServiceServer).Stop(ctx, req.(*empty.Empty)) |
| 665 |
} |
| 666 |
return interceptor(ctx, in, info, handler) |
| 667 |
} |
| 668 |
|
| 669 |
// ReconnectService_ServiceDesc is the grpc.ServiceDesc for ReconnectService service. |
| 670 |
// It's only intended for direct use with grpc.RegisterService, |
| 671 |
// and not to be introspected or modified (even as a copy) |
| 672 |
var ReconnectService_ServiceDesc = grpc.ServiceDesc{ |
| 673 |
ServiceName: "grpc.testing.ReconnectService", |
| 674 |
HandlerType: (*ReconnectServiceServer)(nil), |
| 675 |
Methods: []grpc.MethodDesc{ |
| 676 |
{ |
| 677 |
MethodName: "Start", |
| 678 |
Handler: _ReconnectService_Start_Handler, |
| 679 |
}, |
| 680 |
{ |
| 681 |
MethodName: "Stop", |
| 682 |
Handler: _ReconnectService_Stop_Handler, |
| 683 |
}, |
| 684 |
}, |
| 685 |
Streams: []grpc.StreamDesc{}, |
| 686 |
Metadata: "grpc/testing/test.proto", |
| 687 |
} |
| 688 |
|
| 689 |
const ( |
| 690 |
LoadBalancerStatsService_GetClientStats_FullMethodName = "/grpc.testing.LoadBalancerStatsService/GetClientStats" |
| 691 |
LoadBalancerStatsService_GetClientAccumulatedStats_FullMethodName = "/grpc.testing.LoadBalancerStatsService/GetClientAccumulatedStats" |
| 692 |
) |
| 693 |
|
| 694 |
// LoadBalancerStatsServiceClient is the client API for LoadBalancerStatsService service. |
| 695 |
// |
| 696 |
// 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. |
| 697 |
// |
| 698 |
// A service used to obtain stats for verifying LB behavior. |
| 699 |
type LoadBalancerStatsServiceClient interface { |
| 700 |
// Gets the backend distribution for RPCs sent by a test client. |
| 701 |
GetClientStats(ctx context.Context, in *messages.LoadBalancerStatsRequest, opts ...grpc.CallOption) (*messages.LoadBalancerStatsResponse, error) |
| 702 |
// Gets the accumulated stats for RPCs sent by a test client. |
| 703 |
GetClientAccumulatedStats(ctx context.Context, in *messages.LoadBalancerAccumulatedStatsRequest, opts ...grpc.CallOption) (*messages.LoadBalancerAccumulatedStatsResponse, error) |
| 704 |
} |
| 705 |
|
| 706 |
type loadBalancerStatsServiceClient struct { |
| 707 |
cc grpc.ClientConnInterface |
| 708 |
} |
| 709 |
|
| 710 |
func NewLoadBalancerStatsServiceClient(cc grpc.ClientConnInterface) LoadBalancerStatsServiceClient { |
| 711 |
return &loadBalancerStatsServiceClient{cc} |
| 712 |
} |
| 713 |
|
| 714 |
func (c *loadBalancerStatsServiceClient) GetClientStats(ctx context.Context, in *messages.LoadBalancerStatsRequest, opts ...grpc.CallOption) (*messages.LoadBalancerStatsResponse, error) { |
| 715 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 716 |
out := new(messages.LoadBalancerStatsResponse) |
| 717 |
err := c.cc.Invoke(ctx, LoadBalancerStatsService_GetClientStats_FullMethodName, in, out, cOpts...) |
| 718 |
if err != nil { |
| 719 |
return nil, err |
| 720 |
} |
| 721 |
return out, nil |
| 722 |
} |
| 723 |
|
| 724 |
func (c *loadBalancerStatsServiceClient) GetClientAccumulatedStats(ctx context.Context, in *messages.LoadBalancerAccumulatedStatsRequest, opts ...grpc.CallOption) (*messages.LoadBalancerAccumulatedStatsResponse, error) { |
| 725 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 726 |
out := new(messages.LoadBalancerAccumulatedStatsResponse) |
| 727 |
err := c.cc.Invoke(ctx, LoadBalancerStatsService_GetClientAccumulatedStats_FullMethodName, in, out, cOpts...) |
| 728 |
if err != nil { |
| 729 |
return nil, err |
| 730 |
} |
| 731 |
return out, nil |
| 732 |
} |
| 733 |
|
| 734 |
// LoadBalancerStatsServiceServer is the server API for LoadBalancerStatsService service. |
| 735 |
// All implementations must embed UnimplementedLoadBalancerStatsServiceServer |
| 736 |
// for forward compatibility. |
| 737 |
// |
| 738 |
// A service used to obtain stats for verifying LB behavior. |
| 739 |
type LoadBalancerStatsServiceServer interface { |
| 740 |
// Gets the backend distribution for RPCs sent by a test client. |
| 741 |
GetClientStats(context.Context, *messages.LoadBalancerStatsRequest) (*messages.LoadBalancerStatsResponse, error) |
| 742 |
// Gets the accumulated stats for RPCs sent by a test client. |
| 743 |
GetClientAccumulatedStats(context.Context, *messages.LoadBalancerAccumulatedStatsRequest) (*messages.LoadBalancerAccumulatedStatsResponse, error) |
| 744 |
mustEmbedUnimplementedLoadBalancerStatsServiceServer() |
| 745 |
} |
| 746 |
|
| 747 |
// UnimplementedLoadBalancerStatsServiceServer must be embedded to have |
| 748 |
// forward compatible implementations. |
| 749 |
// |
| 750 |
// NOTE: this should be embedded by value instead of pointer to avoid a nil |
| 751 |
// pointer dereference when methods are called. |
| 752 |
type UnimplementedLoadBalancerStatsServiceServer struct{} |
| 753 |
|
| 754 |
func (UnimplementedLoadBalancerStatsServiceServer) GetClientStats(context.Context, *messages.LoadBalancerStatsRequest) (*messages.LoadBalancerStatsResponse, error) { |
| 755 |
return nil, status.Errorf(codes.Unimplemented, "method GetClientStats not implemented") |
| 756 |
} |
| 757 |
func (UnimplementedLoadBalancerStatsServiceServer) GetClientAccumulatedStats(context.Context, *messages.LoadBalancerAccumulatedStatsRequest) (*messages.LoadBalancerAccumulatedStatsResponse, error) { |
| 758 |
return nil, status.Errorf(codes.Unimplemented, "method GetClientAccumulatedStats not implemented") |
| 759 |
} |
| 760 |
func (UnimplementedLoadBalancerStatsServiceServer) mustEmbedUnimplementedLoadBalancerStatsServiceServer() { |
| 761 |
} |
| 762 |
func (UnimplementedLoadBalancerStatsServiceServer) testEmbeddedByValue() {} |
| 763 |
|
| 764 |
// UnsafeLoadBalancerStatsServiceServer may be embedded to opt out of forward compatibility for this service. |
| 765 |
// Use of this interface is not recommended, as added methods to LoadBalancerStatsServiceServer will |
| 766 |
// result in compilation errors. |
| 767 |
type UnsafeLoadBalancerStatsServiceServer interface { |
| 768 |
mustEmbedUnimplementedLoadBalancerStatsServiceServer() |
| 769 |
} |
| 770 |
|
| 771 |
func RegisterLoadBalancerStatsServiceServer(s grpc.ServiceRegistrar, srv LoadBalancerStatsServiceServer) { |
| 772 |
// If the following call pancis, it indicates UnimplementedLoadBalancerStatsServiceServer was |
| 773 |
// embedded by pointer and is nil. This will cause panics if an |
| 774 |
// unimplemented method is ever invoked, so we test this at initialization |
| 775 |
// time to prevent it from happening at runtime later due to I/O. |
| 776 |
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { |
| 777 |
t.testEmbeddedByValue() |
| 778 |
} |
| 779 |
s.RegisterService(&LoadBalancerStatsService_ServiceDesc, srv) |
| 780 |
} |
| 781 |
|
| 782 |
func _LoadBalancerStatsService_GetClientStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 783 |
in := new(messages.LoadBalancerStatsRequest) |
| 784 |
if err := dec(in); err != nil { |
| 785 |
return nil, err |
| 786 |
} |
| 787 |
if interceptor == nil { |
| 788 |
return srv.(LoadBalancerStatsServiceServer).GetClientStats(ctx, in) |
| 789 |
} |
| 790 |
info := &grpc.UnaryServerInfo{ |
| 791 |
Server: srv, |
| 792 |
FullMethod: LoadBalancerStatsService_GetClientStats_FullMethodName, |
| 793 |
} |
| 794 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 795 |
return srv.(LoadBalancerStatsServiceServer).GetClientStats(ctx, req.(*messages.LoadBalancerStatsRequest)) |
| 796 |
} |
| 797 |
return interceptor(ctx, in, info, handler) |
| 798 |
} |
| 799 |
|
| 800 |
func _LoadBalancerStatsService_GetClientAccumulatedStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 801 |
in := new(messages.LoadBalancerAccumulatedStatsRequest) |
| 802 |
if err := dec(in); err != nil { |
| 803 |
return nil, err |
| 804 |
} |
| 805 |
if interceptor == nil { |
| 806 |
return srv.(LoadBalancerStatsServiceServer).GetClientAccumulatedStats(ctx, in) |
| 807 |
} |
| 808 |
info := &grpc.UnaryServerInfo{ |
| 809 |
Server: srv, |
| 810 |
FullMethod: LoadBalancerStatsService_GetClientAccumulatedStats_FullMethodName, |
| 811 |
} |
| 812 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 813 |
return srv.(LoadBalancerStatsServiceServer).GetClientAccumulatedStats(ctx, req.(*messages.LoadBalancerAccumulatedStatsRequest)) |
| 814 |
} |
| 815 |
return interceptor(ctx, in, info, handler) |
| 816 |
} |
| 817 |
|
| 818 |
// LoadBalancerStatsService_ServiceDesc is the grpc.ServiceDesc for LoadBalancerStatsService service. |
| 819 |
// It's only intended for direct use with grpc.RegisterService, |
| 820 |
// and not to be introspected or modified (even as a copy) |
| 821 |
var LoadBalancerStatsService_ServiceDesc = grpc.ServiceDesc{ |
| 822 |
ServiceName: "grpc.testing.LoadBalancerStatsService", |
| 823 |
HandlerType: (*LoadBalancerStatsServiceServer)(nil), |
| 824 |
Methods: []grpc.MethodDesc{ |
| 825 |
{ |
| 826 |
MethodName: "GetClientStats", |
| 827 |
Handler: _LoadBalancerStatsService_GetClientStats_Handler, |
| 828 |
}, |
| 829 |
{ |
| 830 |
MethodName: "GetClientAccumulatedStats", |
| 831 |
Handler: _LoadBalancerStatsService_GetClientAccumulatedStats_Handler, |
| 832 |
}, |
| 833 |
}, |
| 834 |
Streams: []grpc.StreamDesc{}, |
| 835 |
Metadata: "grpc/testing/test.proto", |
| 836 |
} |
| 837 |
|
| 838 |
const ( |
| 839 |
HookService_Hook_FullMethodName = "/grpc.testing.HookService/Hook" |
| 840 |
HookService_SetReturnStatus_FullMethodName = "/grpc.testing.HookService/SetReturnStatus" |
| 841 |
HookService_ClearReturnStatus_FullMethodName = "/grpc.testing.HookService/ClearReturnStatus" |
| 842 |
) |
| 843 |
|
| 844 |
// HookServiceClient is the client API for HookService service. |
| 845 |
// |
| 846 |
// 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. |
| 847 |
// |
| 848 |
// Hook service. Used to keep Kubernetes from shutting the pod down. |
| 849 |
type HookServiceClient interface { |
| 850 |
// Sends a request that will "hang" until the return status is set by a call |
| 851 |
// to a SetReturnStatus |
| 852 |
Hook(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) |
| 853 |
// Sets a return status for pending and upcoming calls to Hook |
| 854 |
SetReturnStatus(ctx context.Context, in *messages.SetReturnStatusRequest, opts ...grpc.CallOption) (*empty.Empty, error) |
| 855 |
// Clears the return status. Incoming calls to Hook will "hang" |
| 856 |
ClearReturnStatus(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) |
| 857 |
} |
| 858 |
|
| 859 |
type hookServiceClient struct { |
| 860 |
cc grpc.ClientConnInterface |
| 861 |
} |
| 862 |
|
| 863 |
func NewHookServiceClient(cc grpc.ClientConnInterface) HookServiceClient { |
| 864 |
return &hookServiceClient{cc} |
| 865 |
} |
| 866 |
|
| 867 |
func (c *hookServiceClient) Hook(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { |
| 868 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 869 |
out := new(empty.Empty) |
| 870 |
err := c.cc.Invoke(ctx, HookService_Hook_FullMethodName, in, out, cOpts...) |
| 871 |
if err != nil { |
| 872 |
return nil, err |
| 873 |
} |
| 874 |
return out, nil |
| 875 |
} |
| 876 |
|
| 877 |
func (c *hookServiceClient) SetReturnStatus(ctx context.Context, in *messages.SetReturnStatusRequest, opts ...grpc.CallOption) (*empty.Empty, error) { |
| 878 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 879 |
out := new(empty.Empty) |
| 880 |
err := c.cc.Invoke(ctx, HookService_SetReturnStatus_FullMethodName, in, out, cOpts...) |
| 881 |
if err != nil { |
| 882 |
return nil, err |
| 883 |
} |
| 884 |
return out, nil |
| 885 |
} |
| 886 |
|
| 887 |
func (c *hookServiceClient) ClearReturnStatus(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { |
| 888 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 889 |
out := new(empty.Empty) |
| 890 |
err := c.cc.Invoke(ctx, HookService_ClearReturnStatus_FullMethodName, in, out, cOpts...) |
| 891 |
if err != nil { |
| 892 |
return nil, err |
| 893 |
} |
| 894 |
return out, nil |
| 895 |
} |
| 896 |
|
| 897 |
// HookServiceServer is the server API for HookService service. |
| 898 |
// All implementations must embed UnimplementedHookServiceServer |
| 899 |
// for forward compatibility. |
| 900 |
// |
| 901 |
// Hook service. Used to keep Kubernetes from shutting the pod down. |
| 902 |
type HookServiceServer interface { |
| 903 |
// Sends a request that will "hang" until the return status is set by a call |
| 904 |
// to a SetReturnStatus |
| 905 |
Hook(context.Context, *empty.Empty) (*empty.Empty, error) |
| 906 |
// Sets a return status for pending and upcoming calls to Hook |
| 907 |
SetReturnStatus(context.Context, *messages.SetReturnStatusRequest) (*empty.Empty, error) |
| 908 |
// Clears the return status. Incoming calls to Hook will "hang" |
| 909 |
ClearReturnStatus(context.Context, *empty.Empty) (*empty.Empty, error) |
| 910 |
mustEmbedUnimplementedHookServiceServer() |
| 911 |
} |
| 912 |
|
| 913 |
// UnimplementedHookServiceServer must be embedded to have |
| 914 |
// forward compatible implementations. |
| 915 |
// |
| 916 |
// NOTE: this should be embedded by value instead of pointer to avoid a nil |
| 917 |
// pointer dereference when methods are called. |
| 918 |
type UnimplementedHookServiceServer struct{} |
| 919 |
|
| 920 |
func (UnimplementedHookServiceServer) Hook(context.Context, *empty.Empty) (*empty.Empty, error) { |
| 921 |
return nil, status.Errorf(codes.Unimplemented, "method Hook not implemented") |
| 922 |
} |
| 923 |
func (UnimplementedHookServiceServer) SetReturnStatus(context.Context, *messages.SetReturnStatusRequest) (*empty.Empty, error) { |
| 924 |
return nil, status.Errorf(codes.Unimplemented, "method SetReturnStatus not implemented") |
| 925 |
} |
| 926 |
func (UnimplementedHookServiceServer) ClearReturnStatus(context.Context, *empty.Empty) (*empty.Empty, error) { |
| 927 |
return nil, status.Errorf(codes.Unimplemented, "method ClearReturnStatus not implemented") |
| 928 |
} |
| 929 |
func (UnimplementedHookServiceServer) mustEmbedUnimplementedHookServiceServer() {} |
| 930 |
func (UnimplementedHookServiceServer) testEmbeddedByValue() {} |
| 931 |
|
| 932 |
// UnsafeHookServiceServer may be embedded to opt out of forward compatibility for this service. |
| 933 |
// Use of this interface is not recommended, as added methods to HookServiceServer will |
| 934 |
// result in compilation errors. |
| 935 |
type UnsafeHookServiceServer interface { |
| 936 |
mustEmbedUnimplementedHookServiceServer() |
| 937 |
} |
| 938 |
|
| 939 |
func RegisterHookServiceServer(s grpc.ServiceRegistrar, srv HookServiceServer) { |
| 940 |
// If the following call pancis, it indicates UnimplementedHookServiceServer was |
| 941 |
// embedded by pointer and is nil. This will cause panics if an |
| 942 |
// unimplemented method is ever invoked, so we test this at initialization |
| 943 |
// time to prevent it from happening at runtime later due to I/O. |
| 944 |
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { |
| 945 |
t.testEmbeddedByValue() |
| 946 |
} |
| 947 |
s.RegisterService(&HookService_ServiceDesc, srv) |
| 948 |
} |
| 949 |
|
| 950 |
func _HookService_Hook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 951 |
in := new(empty.Empty) |
| 952 |
if err := dec(in); err != nil { |
| 953 |
return nil, err |
| 954 |
} |
| 955 |
if interceptor == nil { |
| 956 |
return srv.(HookServiceServer).Hook(ctx, in) |
| 957 |
} |
| 958 |
info := &grpc.UnaryServerInfo{ |
| 959 |
Server: srv, |
| 960 |
FullMethod: HookService_Hook_FullMethodName, |
| 961 |
} |
| 962 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 963 |
return srv.(HookServiceServer).Hook(ctx, req.(*empty.Empty)) |
| 964 |
} |
| 965 |
return interceptor(ctx, in, info, handler) |
| 966 |
} |
| 967 |
|
| 968 |
func _HookService_SetReturnStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 969 |
in := new(messages.SetReturnStatusRequest) |
| 970 |
if err := dec(in); err != nil { |
| 971 |
return nil, err |
| 972 |
} |
| 973 |
if interceptor == nil { |
| 974 |
return srv.(HookServiceServer).SetReturnStatus(ctx, in) |
| 975 |
} |
| 976 |
info := &grpc.UnaryServerInfo{ |
| 977 |
Server: srv, |
| 978 |
FullMethod: HookService_SetReturnStatus_FullMethodName, |
| 979 |
} |
| 980 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 981 |
return srv.(HookServiceServer).SetReturnStatus(ctx, req.(*messages.SetReturnStatusRequest)) |
| 982 |
} |
| 983 |
return interceptor(ctx, in, info, handler) |
| 984 |
} |
| 985 |
|
| 986 |
func _HookService_ClearReturnStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 987 |
in := new(empty.Empty) |
| 988 |
if err := dec(in); err != nil { |
| 989 |
return nil, err |
| 990 |
} |
| 991 |
if interceptor == nil { |
| 992 |
return srv.(HookServiceServer).ClearReturnStatus(ctx, in) |
| 993 |
} |
| 994 |
info := &grpc.UnaryServerInfo{ |
| 995 |
Server: srv, |
| 996 |
FullMethod: HookService_ClearReturnStatus_FullMethodName, |
| 997 |
} |
| 998 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 999 |
return srv.(HookServiceServer).ClearReturnStatus(ctx, req.(*empty.Empty)) |
| 1000 |
} |
| 1001 |
return interceptor(ctx, in, info, handler) |
| 1002 |
} |
| 1003 |
|
| 1004 |
// HookService_ServiceDesc is the grpc.ServiceDesc for HookService service. |
| 1005 |
// It's only intended for direct use with grpc.RegisterService, |
| 1006 |
// and not to be introspected or modified (even as a copy) |
| 1007 |
var HookService_ServiceDesc = grpc.ServiceDesc{ |
| 1008 |
ServiceName: "grpc.testing.HookService", |
| 1009 |
HandlerType: (*HookServiceServer)(nil), |
| 1010 |
Methods: []grpc.MethodDesc{ |
| 1011 |
{ |
| 1012 |
MethodName: "Hook", |
| 1013 |
Handler: _HookService_Hook_Handler, |
| 1014 |
}, |
| 1015 |
{ |
| 1016 |
MethodName: "SetReturnStatus", |
| 1017 |
Handler: _HookService_SetReturnStatus_Handler, |
| 1018 |
}, |
| 1019 |
{ |
| 1020 |
MethodName: "ClearReturnStatus", |
| 1021 |
Handler: _HookService_ClearReturnStatus_Handler, |
| 1022 |
}, |
| 1023 |
}, |
| 1024 |
Streams: []grpc.StreamDesc{}, |
| 1025 |
Metadata: "grpc/testing/test.proto", |
| 1026 |
} |
| 1027 |
|
| 1028 |
const ( |
| 1029 |
XdsUpdateHealthService_SetServing_FullMethodName = "/grpc.testing.XdsUpdateHealthService/SetServing" |
| 1030 |
XdsUpdateHealthService_SetNotServing_FullMethodName = "/grpc.testing.XdsUpdateHealthService/SetNotServing" |
| 1031 |
XdsUpdateHealthService_SendHookRequest_FullMethodName = "/grpc.testing.XdsUpdateHealthService/SendHookRequest" |
| 1032 |
) |
| 1033 |
|
| 1034 |
// XdsUpdateHealthServiceClient is the client API for XdsUpdateHealthService service. |
| 1035 |
// |
| 1036 |
// 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. |
| 1037 |
// |
| 1038 |
// A service to remotely control health status of an xDS test server. |
| 1039 |
type XdsUpdateHealthServiceClient interface { |
| 1040 |
SetServing(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) |
| 1041 |
SetNotServing(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) |
| 1042 |
SendHookRequest(ctx context.Context, in *messages.HookRequest, opts ...grpc.CallOption) (*messages.HookResponse, error) |
| 1043 |
} |
| 1044 |
|
| 1045 |
type xdsUpdateHealthServiceClient struct { |
| 1046 |
cc grpc.ClientConnInterface |
| 1047 |
} |
| 1048 |
|
| 1049 |
func NewXdsUpdateHealthServiceClient(cc grpc.ClientConnInterface) XdsUpdateHealthServiceClient { |
| 1050 |
return &xdsUpdateHealthServiceClient{cc} |
| 1051 |
} |
| 1052 |
|
| 1053 |
func (c *xdsUpdateHealthServiceClient) SetServing(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { |
| 1054 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 1055 |
out := new(empty.Empty) |
| 1056 |
err := c.cc.Invoke(ctx, XdsUpdateHealthService_SetServing_FullMethodName, in, out, cOpts...) |
| 1057 |
if err != nil { |
| 1058 |
return nil, err |
| 1059 |
} |
| 1060 |
return out, nil |
| 1061 |
} |
| 1062 |
|
| 1063 |
func (c *xdsUpdateHealthServiceClient) SetNotServing(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { |
| 1064 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 1065 |
out := new(empty.Empty) |
| 1066 |
err := c.cc.Invoke(ctx, XdsUpdateHealthService_SetNotServing_FullMethodName, in, out, cOpts...) |
| 1067 |
if err != nil { |
| 1068 |
return nil, err |
| 1069 |
} |
| 1070 |
return out, nil |
| 1071 |
} |
| 1072 |
|
| 1073 |
func (c *xdsUpdateHealthServiceClient) SendHookRequest(ctx context.Context, in *messages.HookRequest, opts ...grpc.CallOption) (*messages.HookResponse, error) { |
| 1074 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 1075 |
out := new(messages.HookResponse) |
| 1076 |
err := c.cc.Invoke(ctx, XdsUpdateHealthService_SendHookRequest_FullMethodName, in, out, cOpts...) |
| 1077 |
if err != nil { |
| 1078 |
return nil, err |
| 1079 |
} |
| 1080 |
return out, nil |
| 1081 |
} |
| 1082 |
|
| 1083 |
// XdsUpdateHealthServiceServer is the server API for XdsUpdateHealthService service. |
| 1084 |
// All implementations must embed UnimplementedXdsUpdateHealthServiceServer |
| 1085 |
// for forward compatibility. |
| 1086 |
// |
| 1087 |
// A service to remotely control health status of an xDS test server. |
| 1088 |
type XdsUpdateHealthServiceServer interface { |
| 1089 |
SetServing(context.Context, *empty.Empty) (*empty.Empty, error) |
| 1090 |
SetNotServing(context.Context, *empty.Empty) (*empty.Empty, error) |
| 1091 |
SendHookRequest(context.Context, *messages.HookRequest) (*messages.HookResponse, error) |
| 1092 |
mustEmbedUnimplementedXdsUpdateHealthServiceServer() |
| 1093 |
} |
| 1094 |
|
| 1095 |
// UnimplementedXdsUpdateHealthServiceServer must be embedded to have |
| 1096 |
// forward compatible implementations. |
| 1097 |
// |
| 1098 |
// NOTE: this should be embedded by value instead of pointer to avoid a nil |
| 1099 |
// pointer dereference when methods are called. |
| 1100 |
type UnimplementedXdsUpdateHealthServiceServer struct{} |
| 1101 |
|
| 1102 |
func (UnimplementedXdsUpdateHealthServiceServer) SetServing(context.Context, *empty.Empty) (*empty.Empty, error) { |
| 1103 |
return nil, status.Errorf(codes.Unimplemented, "method SetServing not implemented") |
| 1104 |
} |
| 1105 |
func (UnimplementedXdsUpdateHealthServiceServer) SetNotServing(context.Context, *empty.Empty) (*empty.Empty, error) { |
| 1106 |
return nil, status.Errorf(codes.Unimplemented, "method SetNotServing not implemented") |
| 1107 |
} |
| 1108 |
func (UnimplementedXdsUpdateHealthServiceServer) SendHookRequest(context.Context, *messages.HookRequest) (*messages.HookResponse, error) { |
| 1109 |
return nil, status.Errorf(codes.Unimplemented, "method SendHookRequest not implemented") |
| 1110 |
} |
| 1111 |
func (UnimplementedXdsUpdateHealthServiceServer) mustEmbedUnimplementedXdsUpdateHealthServiceServer() { |
| 1112 |
} |
| 1113 |
func (UnimplementedXdsUpdateHealthServiceServer) testEmbeddedByValue() {} |
| 1114 |
|
| 1115 |
// UnsafeXdsUpdateHealthServiceServer may be embedded to opt out of forward compatibility for this service. |
| 1116 |
// Use of this interface is not recommended, as added methods to XdsUpdateHealthServiceServer will |
| 1117 |
// result in compilation errors. |
| 1118 |
type UnsafeXdsUpdateHealthServiceServer interface { |
| 1119 |
mustEmbedUnimplementedXdsUpdateHealthServiceServer() |
| 1120 |
} |
| 1121 |
|
| 1122 |
func RegisterXdsUpdateHealthServiceServer(s grpc.ServiceRegistrar, srv XdsUpdateHealthServiceServer) { |
| 1123 |
// If the following call pancis, it indicates UnimplementedXdsUpdateHealthServiceServer was |
| 1124 |
// embedded by pointer and is nil. This will cause panics if an |
| 1125 |
// unimplemented method is ever invoked, so we test this at initialization |
| 1126 |
// time to prevent it from happening at runtime later due to I/O. |
| 1127 |
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { |
| 1128 |
t.testEmbeddedByValue() |
| 1129 |
} |
| 1130 |
s.RegisterService(&XdsUpdateHealthService_ServiceDesc, srv) |
| 1131 |
} |
| 1132 |
|
| 1133 |
func _XdsUpdateHealthService_SetServing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 1134 |
in := new(empty.Empty) |
| 1135 |
if err := dec(in); err != nil { |
| 1136 |
return nil, err |
| 1137 |
} |
| 1138 |
if interceptor == nil { |
| 1139 |
return srv.(XdsUpdateHealthServiceServer).SetServing(ctx, in) |
| 1140 |
} |
| 1141 |
info := &grpc.UnaryServerInfo{ |
| 1142 |
Server: srv, |
| 1143 |
FullMethod: XdsUpdateHealthService_SetServing_FullMethodName, |
| 1144 |
} |
| 1145 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 1146 |
return srv.(XdsUpdateHealthServiceServer).SetServing(ctx, req.(*empty.Empty)) |
| 1147 |
} |
| 1148 |
return interceptor(ctx, in, info, handler) |
| 1149 |
} |
| 1150 |
|
| 1151 |
func _XdsUpdateHealthService_SetNotServing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 1152 |
in := new(empty.Empty) |
| 1153 |
if err := dec(in); err != nil { |
| 1154 |
return nil, err |
| 1155 |
} |
| 1156 |
if interceptor == nil { |
| 1157 |
return srv.(XdsUpdateHealthServiceServer).SetNotServing(ctx, in) |
| 1158 |
} |
| 1159 |
info := &grpc.UnaryServerInfo{ |
| 1160 |
Server: srv, |
| 1161 |
FullMethod: XdsUpdateHealthService_SetNotServing_FullMethodName, |
| 1162 |
} |
| 1163 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 1164 |
return srv.(XdsUpdateHealthServiceServer).SetNotServing(ctx, req.(*empty.Empty)) |
| 1165 |
} |
| 1166 |
return interceptor(ctx, in, info, handler) |
| 1167 |
} |
| 1168 |
|
| 1169 |
func _XdsUpdateHealthService_SendHookRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 1170 |
in := new(messages.HookRequest) |
| 1171 |
if err := dec(in); err != nil { |
| 1172 |
return nil, err |
| 1173 |
} |
| 1174 |
if interceptor == nil { |
| 1175 |
return srv.(XdsUpdateHealthServiceServer).SendHookRequest(ctx, in) |
| 1176 |
} |
| 1177 |
info := &grpc.UnaryServerInfo{ |
| 1178 |
Server: srv, |
| 1179 |
FullMethod: XdsUpdateHealthService_SendHookRequest_FullMethodName, |
| 1180 |
} |
| 1181 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 1182 |
return srv.(XdsUpdateHealthServiceServer).SendHookRequest(ctx, req.(*messages.HookRequest)) |
| 1183 |
} |
| 1184 |
return interceptor(ctx, in, info, handler) |
| 1185 |
} |
| 1186 |
|
| 1187 |
// XdsUpdateHealthService_ServiceDesc is the grpc.ServiceDesc for XdsUpdateHealthService service. |
| 1188 |
// It's only intended for direct use with grpc.RegisterService, |
| 1189 |
// and not to be introspected or modified (even as a copy) |
| 1190 |
var XdsUpdateHealthService_ServiceDesc = grpc.ServiceDesc{ |
| 1191 |
ServiceName: "grpc.testing.XdsUpdateHealthService", |
| 1192 |
HandlerType: (*XdsUpdateHealthServiceServer)(nil), |
| 1193 |
Methods: []grpc.MethodDesc{ |
| 1194 |
{ |
| 1195 |
MethodName: "SetServing", |
| 1196 |
Handler: _XdsUpdateHealthService_SetServing_Handler, |
| 1197 |
}, |
| 1198 |
{ |
| 1199 |
MethodName: "SetNotServing", |
| 1200 |
Handler: _XdsUpdateHealthService_SetNotServing_Handler, |
| 1201 |
}, |
| 1202 |
{ |
| 1203 |
MethodName: "SendHookRequest", |
| 1204 |
Handler: _XdsUpdateHealthService_SendHookRequest_Handler, |
| 1205 |
}, |
| 1206 |
}, |
| 1207 |
Streams: []grpc.StreamDesc{}, |
| 1208 |
Metadata: "grpc/testing/test.proto", |
| 1209 |
} |
| 1210 |
|
| 1211 |
const ( |
| 1212 |
XdsUpdateClientConfigureService_Configure_FullMethodName = "/grpc.testing.XdsUpdateClientConfigureService/Configure" |
| 1213 |
) |
| 1214 |
|
| 1215 |
// XdsUpdateClientConfigureServiceClient is the client API for XdsUpdateClientConfigureService service. |
| 1216 |
// |
| 1217 |
// 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. |
| 1218 |
// |
| 1219 |
// A service to dynamically update the configuration of an xDS test client. |
| 1220 |
type XdsUpdateClientConfigureServiceClient interface { |
| 1221 |
// Update the tes client's configuration. |
| 1222 |
Configure(ctx context.Context, in *messages.ClientConfigureRequest, opts ...grpc.CallOption) (*messages.ClientConfigureResponse, error) |
| 1223 |
} |
| 1224 |
|
| 1225 |
type xdsUpdateClientConfigureServiceClient struct { |
| 1226 |
cc grpc.ClientConnInterface |
| 1227 |
} |
| 1228 |
|
| 1229 |
func NewXdsUpdateClientConfigureServiceClient(cc grpc.ClientConnInterface) XdsUpdateClientConfigureServiceClient { |
| 1230 |
return &xdsUpdateClientConfigureServiceClient{cc} |
| 1231 |
} |
| 1232 |
|
| 1233 |
func (c *xdsUpdateClientConfigureServiceClient) Configure(ctx context.Context, in *messages.ClientConfigureRequest, opts ...grpc.CallOption) (*messages.ClientConfigureResponse, error) { |
| 1234 |
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
| 1235 |
out := new(messages.ClientConfigureResponse) |
| 1236 |
err := c.cc.Invoke(ctx, XdsUpdateClientConfigureService_Configure_FullMethodName, in, out, cOpts...) |
| 1237 |
if err != nil { |
| 1238 |
return nil, err |
| 1239 |
} |
| 1240 |
return out, nil |
| 1241 |
} |
| 1242 |
|
| 1243 |
// XdsUpdateClientConfigureServiceServer is the server API for XdsUpdateClientConfigureService service. |
| 1244 |
// All implementations must embed UnimplementedXdsUpdateClientConfigureServiceServer |
| 1245 |
// for forward compatibility. |
| 1246 |
// |
| 1247 |
// A service to dynamically update the configuration of an xDS test client. |
| 1248 |
type XdsUpdateClientConfigureServiceServer interface { |
| 1249 |
// Update the tes client's configuration. |
| 1250 |
Configure(context.Context, *messages.ClientConfigureRequest) (*messages.ClientConfigureResponse, error) |
| 1251 |
mustEmbedUnimplementedXdsUpdateClientConfigureServiceServer() |
| 1252 |
} |
| 1253 |
|
| 1254 |
// UnimplementedXdsUpdateClientConfigureServiceServer must be embedded to have |
| 1255 |
// forward compatible implementations. |
| 1256 |
// |
| 1257 |
// NOTE: this should be embedded by value instead of pointer to avoid a nil |
| 1258 |
// pointer dereference when methods are called. |
| 1259 |
type UnimplementedXdsUpdateClientConfigureServiceServer struct{} |
| 1260 |
|
| 1261 |
func (UnimplementedXdsUpdateClientConfigureServiceServer) Configure(context.Context, *messages.ClientConfigureRequest) (*messages.ClientConfigureResponse, error) { |
| 1262 |
return nil, status.Errorf(codes.Unimplemented, "method Configure not implemented") |
| 1263 |
} |
| 1264 |
func (UnimplementedXdsUpdateClientConfigureServiceServer) mustEmbedUnimplementedXdsUpdateClientConfigureServiceServer() { |
| 1265 |
} |
| 1266 |
func (UnimplementedXdsUpdateClientConfigureServiceServer) testEmbeddedByValue() {} |
| 1267 |
|
| 1268 |
// UnsafeXdsUpdateClientConfigureServiceServer may be embedded to opt out of forward compatibility for this service. |
| 1269 |
// Use of this interface is not recommended, as added methods to XdsUpdateClientConfigureServiceServer will |
| 1270 |
// result in compilation errors. |
| 1271 |
type UnsafeXdsUpdateClientConfigureServiceServer interface { |
| 1272 |
mustEmbedUnimplementedXdsUpdateClientConfigureServiceServer() |
| 1273 |
} |
| 1274 |
|
| 1275 |
func RegisterXdsUpdateClientConfigureServiceServer(s grpc.ServiceRegistrar, srv XdsUpdateClientConfigureServiceServer) { |
| 1276 |
// If the following call pancis, it indicates UnimplementedXdsUpdateClientConfigureServiceServer was |
| 1277 |
// embedded by pointer and is nil. This will cause panics if an |
| 1278 |
// unimplemented method is ever invoked, so we test this at initialization |
| 1279 |
// time to prevent it from happening at runtime later due to I/O. |
| 1280 |
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { |
| 1281 |
t.testEmbeddedByValue() |
| 1282 |
} |
| 1283 |
s.RegisterService(&XdsUpdateClientConfigureService_ServiceDesc, srv) |
| 1284 |
} |
| 1285 |
|
| 1286 |
func _XdsUpdateClientConfigureService_Configure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 1287 |
in := new(messages.ClientConfigureRequest) |
| 1288 |
if err := dec(in); err != nil { |
| 1289 |
return nil, err |
| 1290 |
} |
| 1291 |
if interceptor == nil { |
| 1292 |
return srv.(XdsUpdateClientConfigureServiceServer).Configure(ctx, in) |
| 1293 |
} |
| 1294 |
info := &grpc.UnaryServerInfo{ |
| 1295 |
Server: srv, |
| 1296 |
FullMethod: XdsUpdateClientConfigureService_Configure_FullMethodName, |
| 1297 |
} |
| 1298 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 1299 |
return srv.(XdsUpdateClientConfigureServiceServer).Configure(ctx, req.(*messages.ClientConfigureRequest)) |
| 1300 |
} |
| 1301 |
return interceptor(ctx, in, info, handler) |
| 1302 |
} |
| 1303 |
|
| 1304 |
// XdsUpdateClientConfigureService_ServiceDesc is the grpc.ServiceDesc for XdsUpdateClientConfigureService service. |
| 1305 |
// It's only intended for direct use with grpc.RegisterService, |
| 1306 |
// and not to be introspected or modified (even as a copy) |
| 1307 |
var XdsUpdateClientConfigureService_ServiceDesc = grpc.ServiceDesc{ |
| 1308 |
ServiceName: "grpc.testing.XdsUpdateClientConfigureService", |
| 1309 |
HandlerType: (*XdsUpdateClientConfigureServiceServer)(nil), |
| 1310 |
Methods: []grpc.MethodDesc{ |
| 1311 |
{ |
| 1312 |
MethodName: "Configure", |
| 1313 |
Handler: _XdsUpdateClientConfigureService_Configure_Handler, |
| 1314 |
}, |
| 1315 |
}, |
| 1316 |
Streams: []grpc.StreamDesc{}, |
| 1317 |
Metadata: "grpc/testing/test.proto", |
| 1318 |
} |