1// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2// versions:
3// - protoc-gen-go-grpc v1.1.0
4// - protoc             v3.14.0
5// source: grpc/testing/benchmark_service.proto
6
7package grpc_testing
8
9import (
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.
19const _ = grpc.SupportPackageIsVersion7
20
21// BenchmarkServiceClient is the client API for BenchmarkService service.
22//
23// 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.
24type BenchmarkServiceClient interface {
25	// One request followed by one response.
26	// The server returns the client payload as-is.
27	UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error)
28	// Repeated sequence of one request followed by one response.
29	// Should be called streaming ping-pong
30	// The server returns the client payload as-is on each response
31	StreamingCall(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingCallClient, error)
32	// Single-sided unbounded streaming from client to server
33	// The server returns the client payload as-is once the client does WritesDone
34	StreamingFromClient(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingFromClientClient, error)
35	// Single-sided unbounded streaming from server to client
36	// The server repeatedly returns the client payload as-is
37	StreamingFromServer(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (BenchmarkService_StreamingFromServerClient, error)
38	// Two-sided unbounded streaming between server to client
39	// Both sides send the content of their own choice to the other
40	StreamingBothWays(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingBothWaysClient, error)
41}
42
43type benchmarkServiceClient struct {
44	cc grpc.ClientConnInterface
45}
46
47func NewBenchmarkServiceClient(cc grpc.ClientConnInterface) BenchmarkServiceClient {
48	return &benchmarkServiceClient{cc}
49}
50
51func (c *benchmarkServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) {
52	out := new(SimpleResponse)
53	err := c.cc.Invoke(ctx, "/grpc.testing.BenchmarkService/UnaryCall", in, out, opts...)
54	if err != nil {
55		return nil, err
56	}
57	return out, nil
58}
59
60func (c *benchmarkServiceClient) StreamingCall(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingCallClient, error) {
61	stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[0], "/grpc.testing.BenchmarkService/StreamingCall", opts...)
62	if err != nil {
63		return nil, err
64	}
65	x := &benchmarkServiceStreamingCallClient{stream}
66	return x, nil
67}
68
69type BenchmarkService_StreamingCallClient interface {
70	Send(*SimpleRequest) error
71	Recv() (*SimpleResponse, error)
72	grpc.ClientStream
73}
74
75type benchmarkServiceStreamingCallClient struct {
76	grpc.ClientStream
77}
78
79func (x *benchmarkServiceStreamingCallClient) Send(m *SimpleRequest) error {
80	return x.ClientStream.SendMsg(m)
81}
82
83func (x *benchmarkServiceStreamingCallClient) Recv() (*SimpleResponse, error) {
84	m := new(SimpleResponse)
85	if err := x.ClientStream.RecvMsg(m); err != nil {
86		return nil, err
87	}
88	return m, nil
89}
90
91func (c *benchmarkServiceClient) StreamingFromClient(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingFromClientClient, error) {
92	stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[1], "/grpc.testing.BenchmarkService/StreamingFromClient", opts...)
93	if err != nil {
94		return nil, err
95	}
96	x := &benchmarkServiceStreamingFromClientClient{stream}
97	return x, nil
98}
99
100type BenchmarkService_StreamingFromClientClient interface {
101	Send(*SimpleRequest) error
102	CloseAndRecv() (*SimpleResponse, error)
103	grpc.ClientStream
104}
105
106type benchmarkServiceStreamingFromClientClient struct {
107	grpc.ClientStream
108}
109
110func (x *benchmarkServiceStreamingFromClientClient) Send(m *SimpleRequest) error {
111	return x.ClientStream.SendMsg(m)
112}
113
114func (x *benchmarkServiceStreamingFromClientClient) CloseAndRecv() (*SimpleResponse, error) {
115	if err := x.ClientStream.CloseSend(); err != nil {
116		return nil, err
117	}
118	m := new(SimpleResponse)
119	if err := x.ClientStream.RecvMsg(m); err != nil {
120		return nil, err
121	}
122	return m, nil
123}
124
125func (c *benchmarkServiceClient) StreamingFromServer(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (BenchmarkService_StreamingFromServerClient, error) {
126	stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[2], "/grpc.testing.BenchmarkService/StreamingFromServer", opts...)
127	if err != nil {
128		return nil, err
129	}
130	x := &benchmarkServiceStreamingFromServerClient{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
140type BenchmarkService_StreamingFromServerClient interface {
141	Recv() (*SimpleResponse, error)
142	grpc.ClientStream
143}
144
145type benchmarkServiceStreamingFromServerClient struct {
146	grpc.ClientStream
147}
148
149func (x *benchmarkServiceStreamingFromServerClient) Recv() (*SimpleResponse, error) {
150	m := new(SimpleResponse)
151	if err := x.ClientStream.RecvMsg(m); err != nil {
152		return nil, err
153	}
154	return m, nil
155}
156
157func (c *benchmarkServiceClient) StreamingBothWays(ctx context.Context, opts ...grpc.CallOption) (BenchmarkService_StreamingBothWaysClient, error) {
158	stream, err := c.cc.NewStream(ctx, &BenchmarkService_ServiceDesc.Streams[3], "/grpc.testing.BenchmarkService/StreamingBothWays", opts...)
159	if err != nil {
160		return nil, err
161	}
162	x := &benchmarkServiceStreamingBothWaysClient{stream}
163	return x, nil
164}
165
166type BenchmarkService_StreamingBothWaysClient interface {
167	Send(*SimpleRequest) error
168	Recv() (*SimpleResponse, error)
169	grpc.ClientStream
170}
171
172type benchmarkServiceStreamingBothWaysClient struct {
173	grpc.ClientStream
174}
175
176func (x *benchmarkServiceStreamingBothWaysClient) Send(m *SimpleRequest) error {
177	return x.ClientStream.SendMsg(m)
178}
179
180func (x *benchmarkServiceStreamingBothWaysClient) Recv() (*SimpleResponse, error) {
181	m := new(SimpleResponse)
182	if err := x.ClientStream.RecvMsg(m); err != nil {
183		return nil, err
184	}
185	return m, nil
186}
187
188// BenchmarkServiceServer is the server API for BenchmarkService service.
189// All implementations must embed UnimplementedBenchmarkServiceServer
190// for forward compatibility
191type BenchmarkServiceServer interface {
192	// One request followed by one response.
193	// The server returns the client payload as-is.
194	UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
195	// Repeated sequence of one request followed by one response.
196	// Should be called streaming ping-pong
197	// The server returns the client payload as-is on each response
198	StreamingCall(BenchmarkService_StreamingCallServer) error
199	// Single-sided unbounded streaming from client to server
200	// The server returns the client payload as-is once the client does WritesDone
201	StreamingFromClient(BenchmarkService_StreamingFromClientServer) error
202	// Single-sided unbounded streaming from server to client
203	// The server repeatedly returns the client payload as-is
204	StreamingFromServer(*SimpleRequest, BenchmarkService_StreamingFromServerServer) error
205	// Two-sided unbounded streaming between server to client
206	// Both sides send the content of their own choice to the other
207	StreamingBothWays(BenchmarkService_StreamingBothWaysServer) error
208	mustEmbedUnimplementedBenchmarkServiceServer()
209}
210
211// UnimplementedBenchmarkServiceServer must be embedded to have forward compatible implementations.
212type UnimplementedBenchmarkServiceServer struct {
213}
214
215func (UnimplementedBenchmarkServiceServer) UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) {
216	return nil, status.Errorf(codes.Unimplemented, "method UnaryCall not implemented")
217}
218func (UnimplementedBenchmarkServiceServer) StreamingCall(BenchmarkService_StreamingCallServer) error {
219	return status.Errorf(codes.Unimplemented, "method StreamingCall not implemented")
220}
221func (UnimplementedBenchmarkServiceServer) StreamingFromClient(BenchmarkService_StreamingFromClientServer) error {
222	return status.Errorf(codes.Unimplemented, "method StreamingFromClient not implemented")
223}
224func (UnimplementedBenchmarkServiceServer) StreamingFromServer(*SimpleRequest, BenchmarkService_StreamingFromServerServer) error {
225	return status.Errorf(codes.Unimplemented, "method StreamingFromServer not implemented")
226}
227func (UnimplementedBenchmarkServiceServer) StreamingBothWays(BenchmarkService_StreamingBothWaysServer) error {
228	return status.Errorf(codes.Unimplemented, "method StreamingBothWays not implemented")
229}
230func (UnimplementedBenchmarkServiceServer) mustEmbedUnimplementedBenchmarkServiceServer() {}
231
232// UnsafeBenchmarkServiceServer may be embedded to opt out of forward compatibility for this service.
233// Use of this interface is not recommended, as added methods to BenchmarkServiceServer will
234// result in compilation errors.
235type UnsafeBenchmarkServiceServer interface {
236	mustEmbedUnimplementedBenchmarkServiceServer()
237}
238
239func RegisterBenchmarkServiceServer(s grpc.ServiceRegistrar, srv BenchmarkServiceServer) {
240	s.RegisterService(&BenchmarkService_ServiceDesc, srv)
241}
242
243func _BenchmarkService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
244	in := new(SimpleRequest)
245	if err := dec(in); err != nil {
246		return nil, err
247	}
248	if interceptor == nil {
249		return srv.(BenchmarkServiceServer).UnaryCall(ctx, in)
250	}
251	info := &grpc.UnaryServerInfo{
252		Server:     srv,
253		FullMethod: "/grpc.testing.BenchmarkService/UnaryCall",
254	}
255	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
256		return srv.(BenchmarkServiceServer).UnaryCall(ctx, req.(*SimpleRequest))
257	}
258	return interceptor(ctx, in, info, handler)
259}
260
261func _BenchmarkService_StreamingCall_Handler(srv interface{}, stream grpc.ServerStream) error {
262	return srv.(BenchmarkServiceServer).StreamingCall(&benchmarkServiceStreamingCallServer{stream})
263}
264
265type BenchmarkService_StreamingCallServer interface {
266	Send(*SimpleResponse) error
267	Recv() (*SimpleRequest, error)
268	grpc.ServerStream
269}
270
271type benchmarkServiceStreamingCallServer struct {
272	grpc.ServerStream
273}
274
275func (x *benchmarkServiceStreamingCallServer) Send(m *SimpleResponse) error {
276	return x.ServerStream.SendMsg(m)
277}
278
279func (x *benchmarkServiceStreamingCallServer) Recv() (*SimpleRequest, error) {
280	m := new(SimpleRequest)
281	if err := x.ServerStream.RecvMsg(m); err != nil {
282		return nil, err
283	}
284	return m, nil
285}
286
287func _BenchmarkService_StreamingFromClient_Handler(srv interface{}, stream grpc.ServerStream) error {
288	return srv.(BenchmarkServiceServer).StreamingFromClient(&benchmarkServiceStreamingFromClientServer{stream})
289}
290
291type BenchmarkService_StreamingFromClientServer interface {
292	SendAndClose(*SimpleResponse) error
293	Recv() (*SimpleRequest, error)
294	grpc.ServerStream
295}
296
297type benchmarkServiceStreamingFromClientServer struct {
298	grpc.ServerStream
299}
300
301func (x *benchmarkServiceStreamingFromClientServer) SendAndClose(m *SimpleResponse) error {
302	return x.ServerStream.SendMsg(m)
303}
304
305func (x *benchmarkServiceStreamingFromClientServer) Recv() (*SimpleRequest, error) {
306	m := new(SimpleRequest)
307	if err := x.ServerStream.RecvMsg(m); err != nil {
308		return nil, err
309	}
310	return m, nil
311}
312
313func _BenchmarkService_StreamingFromServer_Handler(srv interface{}, stream grpc.ServerStream) error {
314	m := new(SimpleRequest)
315	if err := stream.RecvMsg(m); err != nil {
316		return err
317	}
318	return srv.(BenchmarkServiceServer).StreamingFromServer(m, &benchmarkServiceStreamingFromServerServer{stream})
319}
320
321type BenchmarkService_StreamingFromServerServer interface {
322	Send(*SimpleResponse) error
323	grpc.ServerStream
324}
325
326type benchmarkServiceStreamingFromServerServer struct {
327	grpc.ServerStream
328}
329
330func (x *benchmarkServiceStreamingFromServerServer) Send(m *SimpleResponse) error {
331	return x.ServerStream.SendMsg(m)
332}
333
334func _BenchmarkService_StreamingBothWays_Handler(srv interface{}, stream grpc.ServerStream) error {
335	return srv.(BenchmarkServiceServer).StreamingBothWays(&benchmarkServiceStreamingBothWaysServer{stream})
336}
337
338type BenchmarkService_StreamingBothWaysServer interface {
339	Send(*SimpleResponse) error
340	Recv() (*SimpleRequest, error)
341	grpc.ServerStream
342}
343
344type benchmarkServiceStreamingBothWaysServer struct {
345	grpc.ServerStream
346}
347
348func (x *benchmarkServiceStreamingBothWaysServer) Send(m *SimpleResponse) error {
349	return x.ServerStream.SendMsg(m)
350}
351
352func (x *benchmarkServiceStreamingBothWaysServer) Recv() (*SimpleRequest, error) {
353	m := new(SimpleRequest)
354	if err := x.ServerStream.RecvMsg(m); err != nil {
355		return nil, err
356	}
357	return m, nil
358}
359
360// BenchmarkService_ServiceDesc is the grpc.ServiceDesc for BenchmarkService service.
361// It's only intended for direct use with grpc.RegisterService,
362// and not to be introspected or modified (even as a copy)
363var BenchmarkService_ServiceDesc = grpc.ServiceDesc{
364	ServiceName: "grpc.testing.BenchmarkService",
365	HandlerType: (*BenchmarkServiceServer)(nil),
366	Methods: []grpc.MethodDesc{
367		{
368			MethodName: "UnaryCall",
369			Handler:    _BenchmarkService_UnaryCall_Handler,
370		},
371	},
372	Streams: []grpc.StreamDesc{
373		{
374			StreamName:    "StreamingCall",
375			Handler:       _BenchmarkService_StreamingCall_Handler,
376			ServerStreams: true,
377			ClientStreams: true,
378		},
379		{
380			StreamName:    "StreamingFromClient",
381			Handler:       _BenchmarkService_StreamingFromClient_Handler,
382			ClientStreams: true,
383		},
384		{
385			StreamName:    "StreamingFromServer",
386			Handler:       _BenchmarkService_StreamingFromServer_Handler,
387			ServerStreams: true,
388		},
389		{
390			StreamName:    "StreamingBothWays",
391			Handler:       _BenchmarkService_StreamingBothWays_Handler,
392			ServerStreams: true,
393			ClientStreams: true,
394		},
395	},
396	Metadata: "grpc/testing/benchmark_service.proto",
397}
398