1// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
3package grpc_testing
4
5import (
6	context "context"
7	grpc "google.golang.org/grpc"
8	codes "google.golang.org/grpc/codes"
9	status "google.golang.org/grpc/status"
10)
11
12// This is a compile-time assertion to ensure that this generated file
13// is compatible with the grpc package it is being compiled against.
14// Requires gRPC-Go v1.32.0 or later.
15const _ = grpc.SupportPackageIsVersion7
16
17// WorkerServiceClient is the client API for WorkerService service.
18//
19// 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.
20type WorkerServiceClient interface {
21	// Start server with specified workload.
22	// First request sent specifies the ServerConfig followed by ServerStatus
23	// response. After that, a "Mark" can be sent anytime to request the latest
24	// stats. Closing the stream will initiate shutdown of the test server
25	// and once the shutdown has finished, the OK status is sent to terminate
26	// this RPC.
27	RunServer(ctx context.Context, opts ...grpc.CallOption) (WorkerService_RunServerClient, error)
28	// Start client with specified workload.
29	// First request sent specifies the ClientConfig followed by ClientStatus
30	// response. After that, a "Mark" can be sent anytime to request the latest
31	// stats. Closing the stream will initiate shutdown of the test client
32	// and once the shutdown has finished, the OK status is sent to terminate
33	// this RPC.
34	RunClient(ctx context.Context, opts ...grpc.CallOption) (WorkerService_RunClientClient, error)
35	// Just return the core count - unary call
36	CoreCount(ctx context.Context, in *CoreRequest, opts ...grpc.CallOption) (*CoreResponse, error)
37	// Quit this worker
38	QuitWorker(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Void, error)
39}
40
41type workerServiceClient struct {
42	cc grpc.ClientConnInterface
43}
44
45func NewWorkerServiceClient(cc grpc.ClientConnInterface) WorkerServiceClient {
46	return &workerServiceClient{cc}
47}
48
49func (c *workerServiceClient) RunServer(ctx context.Context, opts ...grpc.CallOption) (WorkerService_RunServerClient, error) {
50	stream, err := c.cc.NewStream(ctx, &WorkerService_ServiceDesc.Streams[0], "/grpc.testing.WorkerService/RunServer", opts...)
51	if err != nil {
52		return nil, err
53	}
54	x := &workerServiceRunServerClient{stream}
55	return x, nil
56}
57
58type WorkerService_RunServerClient interface {
59	Send(*ServerArgs) error
60	Recv() (*ServerStatus, error)
61	grpc.ClientStream
62}
63
64type workerServiceRunServerClient struct {
65	grpc.ClientStream
66}
67
68func (x *workerServiceRunServerClient) Send(m *ServerArgs) error {
69	return x.ClientStream.SendMsg(m)
70}
71
72func (x *workerServiceRunServerClient) Recv() (*ServerStatus, error) {
73	m := new(ServerStatus)
74	if err := x.ClientStream.RecvMsg(m); err != nil {
75		return nil, err
76	}
77	return m, nil
78}
79
80func (c *workerServiceClient) RunClient(ctx context.Context, opts ...grpc.CallOption) (WorkerService_RunClientClient, error) {
81	stream, err := c.cc.NewStream(ctx, &WorkerService_ServiceDesc.Streams[1], "/grpc.testing.WorkerService/RunClient", opts...)
82	if err != nil {
83		return nil, err
84	}
85	x := &workerServiceRunClientClient{stream}
86	return x, nil
87}
88
89type WorkerService_RunClientClient interface {
90	Send(*ClientArgs) error
91	Recv() (*ClientStatus, error)
92	grpc.ClientStream
93}
94
95type workerServiceRunClientClient struct {
96	grpc.ClientStream
97}
98
99func (x *workerServiceRunClientClient) Send(m *ClientArgs) error {
100	return x.ClientStream.SendMsg(m)
101}
102
103func (x *workerServiceRunClientClient) Recv() (*ClientStatus, error) {
104	m := new(ClientStatus)
105	if err := x.ClientStream.RecvMsg(m); err != nil {
106		return nil, err
107	}
108	return m, nil
109}
110
111func (c *workerServiceClient) CoreCount(ctx context.Context, in *CoreRequest, opts ...grpc.CallOption) (*CoreResponse, error) {
112	out := new(CoreResponse)
113	err := c.cc.Invoke(ctx, "/grpc.testing.WorkerService/CoreCount", in, out, opts...)
114	if err != nil {
115		return nil, err
116	}
117	return out, nil
118}
119
120func (c *workerServiceClient) QuitWorker(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Void, error) {
121	out := new(Void)
122	err := c.cc.Invoke(ctx, "/grpc.testing.WorkerService/QuitWorker", in, out, opts...)
123	if err != nil {
124		return nil, err
125	}
126	return out, nil
127}
128
129// WorkerServiceServer is the server API for WorkerService service.
130// All implementations must embed UnimplementedWorkerServiceServer
131// for forward compatibility
132type WorkerServiceServer interface {
133	// Start server with specified workload.
134	// First request sent specifies the ServerConfig followed by ServerStatus
135	// response. After that, a "Mark" can be sent anytime to request the latest
136	// stats. Closing the stream will initiate shutdown of the test server
137	// and once the shutdown has finished, the OK status is sent to terminate
138	// this RPC.
139	RunServer(WorkerService_RunServerServer) error
140	// Start client with specified workload.
141	// First request sent specifies the ClientConfig followed by ClientStatus
142	// response. After that, a "Mark" can be sent anytime to request the latest
143	// stats. Closing the stream will initiate shutdown of the test client
144	// and once the shutdown has finished, the OK status is sent to terminate
145	// this RPC.
146	RunClient(WorkerService_RunClientServer) error
147	// Just return the core count - unary call
148	CoreCount(context.Context, *CoreRequest) (*CoreResponse, error)
149	// Quit this worker
150	QuitWorker(context.Context, *Void) (*Void, error)
151	mustEmbedUnimplementedWorkerServiceServer()
152}
153
154// UnimplementedWorkerServiceServer must be embedded to have forward compatible implementations.
155type UnimplementedWorkerServiceServer struct {
156}
157
158func (UnimplementedWorkerServiceServer) RunServer(WorkerService_RunServerServer) error {
159	return status.Errorf(codes.Unimplemented, "method RunServer not implemented")
160}
161func (UnimplementedWorkerServiceServer) RunClient(WorkerService_RunClientServer) error {
162	return status.Errorf(codes.Unimplemented, "method RunClient not implemented")
163}
164func (UnimplementedWorkerServiceServer) CoreCount(context.Context, *CoreRequest) (*CoreResponse, error) {
165	return nil, status.Errorf(codes.Unimplemented, "method CoreCount not implemented")
166}
167func (UnimplementedWorkerServiceServer) QuitWorker(context.Context, *Void) (*Void, error) {
168	return nil, status.Errorf(codes.Unimplemented, "method QuitWorker not implemented")
169}
170func (UnimplementedWorkerServiceServer) mustEmbedUnimplementedWorkerServiceServer() {}
171
172// UnsafeWorkerServiceServer may be embedded to opt out of forward compatibility for this service.
173// Use of this interface is not recommended, as added methods to WorkerServiceServer will
174// result in compilation errors.
175type UnsafeWorkerServiceServer interface {
176	mustEmbedUnimplementedWorkerServiceServer()
177}
178
179func RegisterWorkerServiceServer(s grpc.ServiceRegistrar, srv WorkerServiceServer) {
180	s.RegisterService(&WorkerService_ServiceDesc, srv)
181}
182
183func _WorkerService_RunServer_Handler(srv interface{}, stream grpc.ServerStream) error {
184	return srv.(WorkerServiceServer).RunServer(&workerServiceRunServerServer{stream})
185}
186
187type WorkerService_RunServerServer interface {
188	Send(*ServerStatus) error
189	Recv() (*ServerArgs, error)
190	grpc.ServerStream
191}
192
193type workerServiceRunServerServer struct {
194	grpc.ServerStream
195}
196
197func (x *workerServiceRunServerServer) Send(m *ServerStatus) error {
198	return x.ServerStream.SendMsg(m)
199}
200
201func (x *workerServiceRunServerServer) Recv() (*ServerArgs, error) {
202	m := new(ServerArgs)
203	if err := x.ServerStream.RecvMsg(m); err != nil {
204		return nil, err
205	}
206	return m, nil
207}
208
209func _WorkerService_RunClient_Handler(srv interface{}, stream grpc.ServerStream) error {
210	return srv.(WorkerServiceServer).RunClient(&workerServiceRunClientServer{stream})
211}
212
213type WorkerService_RunClientServer interface {
214	Send(*ClientStatus) error
215	Recv() (*ClientArgs, error)
216	grpc.ServerStream
217}
218
219type workerServiceRunClientServer struct {
220	grpc.ServerStream
221}
222
223func (x *workerServiceRunClientServer) Send(m *ClientStatus) error {
224	return x.ServerStream.SendMsg(m)
225}
226
227func (x *workerServiceRunClientServer) Recv() (*ClientArgs, error) {
228	m := new(ClientArgs)
229	if err := x.ServerStream.RecvMsg(m); err != nil {
230		return nil, err
231	}
232	return m, nil
233}
234
235func _WorkerService_CoreCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
236	in := new(CoreRequest)
237	if err := dec(in); err != nil {
238		return nil, err
239	}
240	if interceptor == nil {
241		return srv.(WorkerServiceServer).CoreCount(ctx, in)
242	}
243	info := &grpc.UnaryServerInfo{
244		Server:     srv,
245		FullMethod: "/grpc.testing.WorkerService/CoreCount",
246	}
247	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
248		return srv.(WorkerServiceServer).CoreCount(ctx, req.(*CoreRequest))
249	}
250	return interceptor(ctx, in, info, handler)
251}
252
253func _WorkerService_QuitWorker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
254	in := new(Void)
255	if err := dec(in); err != nil {
256		return nil, err
257	}
258	if interceptor == nil {
259		return srv.(WorkerServiceServer).QuitWorker(ctx, in)
260	}
261	info := &grpc.UnaryServerInfo{
262		Server:     srv,
263		FullMethod: "/grpc.testing.WorkerService/QuitWorker",
264	}
265	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
266		return srv.(WorkerServiceServer).QuitWorker(ctx, req.(*Void))
267	}
268	return interceptor(ctx, in, info, handler)
269}
270
271// WorkerService_ServiceDesc is the grpc.ServiceDesc for WorkerService service.
272// It's only intended for direct use with grpc.RegisterService,
273// and not to be introspected or modified (even as a copy)
274var WorkerService_ServiceDesc = grpc.ServiceDesc{
275	ServiceName: "grpc.testing.WorkerService",
276	HandlerType: (*WorkerServiceServer)(nil),
277	Methods: []grpc.MethodDesc{
278		{
279			MethodName: "CoreCount",
280			Handler:    _WorkerService_CoreCount_Handler,
281		},
282		{
283			MethodName: "QuitWorker",
284			Handler:    _WorkerService_QuitWorker_Handler,
285		},
286	},
287	Streams: []grpc.StreamDesc{
288		{
289			StreamName:    "RunServer",
290			Handler:       _WorkerService_RunServer_Handler,
291			ServerStreams: true,
292			ClientStreams: true,
293		},
294		{
295			StreamName:    "RunClient",
296			Handler:       _WorkerService_RunClient_Handler,
297			ServerStreams: true,
298			ClientStreams: true,
299		},
300	},
301	Metadata: "grpc/testing/worker_service.proto",
302}
303