-
Notifications
You must be signed in to change notification settings - Fork 0
/
piro_grpc.pb.go
550 lines (498 loc) · 19.6 KB
/
piro_grpc.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package v1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// PiroServiceClient is the client API for PiroService service.
//
// 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.
type PiroServiceClient interface {
// StartLocalJob starts a Kubernetes Job by uploading Bhojpur.NET Platform
// application content directly. The incoming requests are expected in the
// following order:
// 1. metadata
// 2. all bytes constituting the piro/config.yaml
// 3. all bytes constituting the job YAML that will be executed (that the config.yaml points to)
// 4. all bytes constituting the gzipped Bhojpur.NET Platform application tar stream
// 5. the Bhojpur.NET Platform application tar stream done marker
StartLocalJob(ctx context.Context, opts ...grpc.CallOption) (PiroService_StartLocalJobClient, error)
// StartGitHubJob starts a job on a Git context, possibly with a custom job.
StartGitHubJob(ctx context.Context, in *StartGitHubJobRequest, opts ...grpc.CallOption) (*StartJobResponse, error)
// StartFromPreviousJob starts a new job based on a previous one.
// If the previous job does not have the can-replay condition set this call will result in an error.
StartFromPreviousJob(ctx context.Context, in *StartFromPreviousJobRequest, opts ...grpc.CallOption) (*StartJobResponse, error)
// StartJobRequest starts a new job based on its specification.
StartJob(ctx context.Context, in *StartJobRequest, opts ...grpc.CallOption) (*StartJobResponse, error)
// StartJob2 starts a new job based on its specification.
StartJob2(ctx context.Context, in *StartJobRequest2, opts ...grpc.CallOption) (*StartJobResponse, error)
// Searches for jobs known to this instance
ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error)
// Subscribe listens to new jobs/job updates
Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (PiroService_SubscribeClient, error)
// GetJob retrieves details of a single job
GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*GetJobResponse, error)
// Listen listens to job updates and log output of a running job
Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (PiroService_ListenClient, error)
// StopJob stops a currently running job
StopJob(ctx context.Context, in *StopJobRequest, opts ...grpc.CallOption) (*StopJobResponse, error)
}
type piroServiceClient struct {
cc grpc.ClientConnInterface
}
func NewPiroServiceClient(cc grpc.ClientConnInterface) PiroServiceClient {
return &piroServiceClient{cc}
}
func (c *piroServiceClient) StartLocalJob(ctx context.Context, opts ...grpc.CallOption) (PiroService_StartLocalJobClient, error) {
stream, err := c.cc.NewStream(ctx, &PiroService_ServiceDesc.Streams[0], "/v1.PiroService/StartLocalJob", opts...)
if err != nil {
return nil, err
}
x := &piroServiceStartLocalJobClient{stream}
return x, nil
}
type PiroService_StartLocalJobClient interface {
Send(*StartLocalJobRequest) error
CloseAndRecv() (*StartJobResponse, error)
grpc.ClientStream
}
type piroServiceStartLocalJobClient struct {
grpc.ClientStream
}
func (x *piroServiceStartLocalJobClient) Send(m *StartLocalJobRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *piroServiceStartLocalJobClient) CloseAndRecv() (*StartJobResponse, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(StartJobResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *piroServiceClient) StartGitHubJob(ctx context.Context, in *StartGitHubJobRequest, opts ...grpc.CallOption) (*StartJobResponse, error) {
out := new(StartJobResponse)
err := c.cc.Invoke(ctx, "/v1.PiroService/StartGitHubJob", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *piroServiceClient) StartFromPreviousJob(ctx context.Context, in *StartFromPreviousJobRequest, opts ...grpc.CallOption) (*StartJobResponse, error) {
out := new(StartJobResponse)
err := c.cc.Invoke(ctx, "/v1.PiroService/StartFromPreviousJob", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *piroServiceClient) StartJob(ctx context.Context, in *StartJobRequest, opts ...grpc.CallOption) (*StartJobResponse, error) {
out := new(StartJobResponse)
err := c.cc.Invoke(ctx, "/v1.PiroService/StartJob", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *piroServiceClient) StartJob2(ctx context.Context, in *StartJobRequest2, opts ...grpc.CallOption) (*StartJobResponse, error) {
out := new(StartJobResponse)
err := c.cc.Invoke(ctx, "/v1.PiroService/StartJob2", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *piroServiceClient) ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error) {
out := new(ListJobsResponse)
err := c.cc.Invoke(ctx, "/v1.PiroService/ListJobs", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *piroServiceClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (PiroService_SubscribeClient, error) {
stream, err := c.cc.NewStream(ctx, &PiroService_ServiceDesc.Streams[1], "/v1.PiroService/Subscribe", opts...)
if err != nil {
return nil, err
}
x := &piroServiceSubscribeClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type PiroService_SubscribeClient interface {
Recv() (*SubscribeResponse, error)
grpc.ClientStream
}
type piroServiceSubscribeClient struct {
grpc.ClientStream
}
func (x *piroServiceSubscribeClient) Recv() (*SubscribeResponse, error) {
m := new(SubscribeResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *piroServiceClient) GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*GetJobResponse, error) {
out := new(GetJobResponse)
err := c.cc.Invoke(ctx, "/v1.PiroService/GetJob", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *piroServiceClient) Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (PiroService_ListenClient, error) {
stream, err := c.cc.NewStream(ctx, &PiroService_ServiceDesc.Streams[2], "/v1.PiroService/Listen", opts...)
if err != nil {
return nil, err
}
x := &piroServiceListenClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type PiroService_ListenClient interface {
Recv() (*ListenResponse, error)
grpc.ClientStream
}
type piroServiceListenClient struct {
grpc.ClientStream
}
func (x *piroServiceListenClient) Recv() (*ListenResponse, error) {
m := new(ListenResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *piroServiceClient) StopJob(ctx context.Context, in *StopJobRequest, opts ...grpc.CallOption) (*StopJobResponse, error) {
out := new(StopJobResponse)
err := c.cc.Invoke(ctx, "/v1.PiroService/StopJob", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// PiroServiceServer is the server API for PiroService service.
// All implementations must embed UnimplementedPiroServiceServer
// for forward compatibility
type PiroServiceServer interface {
// StartLocalJob starts a Kubernetes Job by uploading Bhojpur.NET Platform
// application content directly. The incoming requests are expected in the
// following order:
// 1. metadata
// 2. all bytes constituting the piro/config.yaml
// 3. all bytes constituting the job YAML that will be executed (that the config.yaml points to)
// 4. all bytes constituting the gzipped Bhojpur.NET Platform application tar stream
// 5. the Bhojpur.NET Platform application tar stream done marker
StartLocalJob(PiroService_StartLocalJobServer) error
// StartGitHubJob starts a job on a Git context, possibly with a custom job.
StartGitHubJob(context.Context, *StartGitHubJobRequest) (*StartJobResponse, error)
// StartFromPreviousJob starts a new job based on a previous one.
// If the previous job does not have the can-replay condition set this call will result in an error.
StartFromPreviousJob(context.Context, *StartFromPreviousJobRequest) (*StartJobResponse, error)
// StartJobRequest starts a new job based on its specification.
StartJob(context.Context, *StartJobRequest) (*StartJobResponse, error)
// StartJob2 starts a new job based on its specification.
StartJob2(context.Context, *StartJobRequest2) (*StartJobResponse, error)
// Searches for jobs known to this instance
ListJobs(context.Context, *ListJobsRequest) (*ListJobsResponse, error)
// Subscribe listens to new jobs/job updates
Subscribe(*SubscribeRequest, PiroService_SubscribeServer) error
// GetJob retrieves details of a single job
GetJob(context.Context, *GetJobRequest) (*GetJobResponse, error)
// Listen listens to job updates and log output of a running job
Listen(*ListenRequest, PiroService_ListenServer) error
// StopJob stops a currently running job
StopJob(context.Context, *StopJobRequest) (*StopJobResponse, error)
mustEmbedUnimplementedPiroServiceServer()
}
// UnimplementedPiroServiceServer must be embedded to have forward compatible implementations.
type UnimplementedPiroServiceServer struct {
}
func (UnimplementedPiroServiceServer) StartLocalJob(PiroService_StartLocalJobServer) error {
return status.Errorf(codes.Unimplemented, "method StartLocalJob not implemented")
}
func (UnimplementedPiroServiceServer) StartGitHubJob(context.Context, *StartGitHubJobRequest) (*StartJobResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StartGitHubJob not implemented")
}
func (UnimplementedPiroServiceServer) StartFromPreviousJob(context.Context, *StartFromPreviousJobRequest) (*StartJobResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StartFromPreviousJob not implemented")
}
func (UnimplementedPiroServiceServer) StartJob(context.Context, *StartJobRequest) (*StartJobResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StartJob not implemented")
}
func (UnimplementedPiroServiceServer) StartJob2(context.Context, *StartJobRequest2) (*StartJobResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StartJob2 not implemented")
}
func (UnimplementedPiroServiceServer) ListJobs(context.Context, *ListJobsRequest) (*ListJobsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListJobs not implemented")
}
func (UnimplementedPiroServiceServer) Subscribe(*SubscribeRequest, PiroService_SubscribeServer) error {
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
}
func (UnimplementedPiroServiceServer) GetJob(context.Context, *GetJobRequest) (*GetJobResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetJob not implemented")
}
func (UnimplementedPiroServiceServer) Listen(*ListenRequest, PiroService_ListenServer) error {
return status.Errorf(codes.Unimplemented, "method Listen not implemented")
}
func (UnimplementedPiroServiceServer) StopJob(context.Context, *StopJobRequest) (*StopJobResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StopJob not implemented")
}
func (UnimplementedPiroServiceServer) mustEmbedUnimplementedPiroServiceServer() {}
// UnsafePiroServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PiroServiceServer will
// result in compilation errors.
type UnsafePiroServiceServer interface {
mustEmbedUnimplementedPiroServiceServer()
}
func RegisterPiroServiceServer(s grpc.ServiceRegistrar, srv PiroServiceServer) {
s.RegisterService(&PiroService_ServiceDesc, srv)
}
func _PiroService_StartLocalJob_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(PiroServiceServer).StartLocalJob(&piroServiceStartLocalJobServer{stream})
}
type PiroService_StartLocalJobServer interface {
SendAndClose(*StartJobResponse) error
Recv() (*StartLocalJobRequest, error)
grpc.ServerStream
}
type piroServiceStartLocalJobServer struct {
grpc.ServerStream
}
func (x *piroServiceStartLocalJobServer) SendAndClose(m *StartJobResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *piroServiceStartLocalJobServer) Recv() (*StartLocalJobRequest, error) {
m := new(StartLocalJobRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _PiroService_StartGitHubJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StartGitHubJobRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PiroServiceServer).StartGitHubJob(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/v1.PiroService/StartGitHubJob",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PiroServiceServer).StartGitHubJob(ctx, req.(*StartGitHubJobRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PiroService_StartFromPreviousJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StartFromPreviousJobRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PiroServiceServer).StartFromPreviousJob(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/v1.PiroService/StartFromPreviousJob",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PiroServiceServer).StartFromPreviousJob(ctx, req.(*StartFromPreviousJobRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PiroService_StartJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StartJobRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PiroServiceServer).StartJob(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/v1.PiroService/StartJob",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PiroServiceServer).StartJob(ctx, req.(*StartJobRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PiroService_StartJob2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StartJobRequest2)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PiroServiceServer).StartJob2(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/v1.PiroService/StartJob2",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PiroServiceServer).StartJob2(ctx, req.(*StartJobRequest2))
}
return interceptor(ctx, in, info, handler)
}
func _PiroService_ListJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListJobsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PiroServiceServer).ListJobs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/v1.PiroService/ListJobs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PiroServiceServer).ListJobs(ctx, req.(*ListJobsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PiroService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SubscribeRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(PiroServiceServer).Subscribe(m, &piroServiceSubscribeServer{stream})
}
type PiroService_SubscribeServer interface {
Send(*SubscribeResponse) error
grpc.ServerStream
}
type piroServiceSubscribeServer struct {
grpc.ServerStream
}
func (x *piroServiceSubscribeServer) Send(m *SubscribeResponse) error {
return x.ServerStream.SendMsg(m)
}
func _PiroService_GetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetJobRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PiroServiceServer).GetJob(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/v1.PiroService/GetJob",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PiroServiceServer).GetJob(ctx, req.(*GetJobRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PiroService_Listen_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(ListenRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(PiroServiceServer).Listen(m, &piroServiceListenServer{stream})
}
type PiroService_ListenServer interface {
Send(*ListenResponse) error
grpc.ServerStream
}
type piroServiceListenServer struct {
grpc.ServerStream
}
func (x *piroServiceListenServer) Send(m *ListenResponse) error {
return x.ServerStream.SendMsg(m)
}
func _PiroService_StopJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StopJobRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PiroServiceServer).StopJob(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/v1.PiroService/StopJob",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PiroServiceServer).StopJob(ctx, req.(*StopJobRequest))
}
return interceptor(ctx, in, info, handler)
}
// PiroService_ServiceDesc is the grpc.ServiceDesc for PiroService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PiroService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "v1.PiroService",
HandlerType: (*PiroServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "StartGitHubJob",
Handler: _PiroService_StartGitHubJob_Handler,
},
{
MethodName: "StartFromPreviousJob",
Handler: _PiroService_StartFromPreviousJob_Handler,
},
{
MethodName: "StartJob",
Handler: _PiroService_StartJob_Handler,
},
{
MethodName: "StartJob2",
Handler: _PiroService_StartJob2_Handler,
},
{
MethodName: "ListJobs",
Handler: _PiroService_ListJobs_Handler,
},
{
MethodName: "GetJob",
Handler: _PiroService_GetJob_Handler,
},
{
MethodName: "StopJob",
Handler: _PiroService_StopJob_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "StartLocalJob",
Handler: _PiroService_StartLocalJob_Handler,
ClientStreams: true,
},
{
StreamName: "Subscribe",
Handler: _PiroService_Subscribe_Handler,
ServerStreams: true,
},
{
StreamName: "Listen",
Handler: _PiroService_Listen_Handler,
ServerStreams: true,
},
},
Metadata: "piro.proto",
}