-
Notifications
You must be signed in to change notification settings - Fork 3
/
deckard_service_grpc.pb.go
487 lines (454 loc) · 18.2 KB
/
deckard_service_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
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v3.12.4
// source: deckard_service.proto
package deckard
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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Deckard_Add_FullMethodName = "/blipai.deckard.Deckard/Add"
Deckard_Pull_FullMethodName = "/blipai.deckard.Deckard/Pull"
Deckard_Ack_FullMethodName = "/blipai.deckard.Deckard/Ack"
Deckard_Nack_FullMethodName = "/blipai.deckard.Deckard/Nack"
Deckard_Count_FullMethodName = "/blipai.deckard.Deckard/Count"
Deckard_Remove_FullMethodName = "/blipai.deckard.Deckard/Remove"
Deckard_Flush_FullMethodName = "/blipai.deckard.Deckard/Flush"
Deckard_GetById_FullMethodName = "/blipai.deckard.Deckard/GetById"
Deckard_EditQueue_FullMethodName = "/blipai.deckard.Deckard/EditQueue"
Deckard_GetQueue_FullMethodName = "/blipai.deckard.Deckard/GetQueue"
)
// DeckardClient is the client API for Deckard 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 DeckardClient interface {
// Adds messages to the queue. If any message already exists (same id and queue) it will be updated
Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error)
// Pulls messages from the queue
Pull(ctx context.Context, in *PullRequest, opts ...grpc.CallOption) (*PullResponse, error)
// Acks a message, marking it as successfully processed
Ack(ctx context.Context, in *AckRequest, opts ...grpc.CallOption) (*AckResponse, error)
// Nacks a message, marking it as not processed
Nack(ctx context.Context, in *AckRequest, opts ...grpc.CallOption) (*AckResponse, error)
// Counts number of messages on queue based on a filter request
Count(ctx context.Context, in *CountRequest, opts ...grpc.CallOption) (*CountResponse, error)
// Removes one or many messages from the queue based on its ids
Remove(ctx context.Context, in *RemoveRequest, opts ...grpc.CallOption) (*RemoveResponse, error)
// Discards all deckard data from storage and cache.
// This request is only available if deckard instance is configured with MEMORY cache and storage.
Flush(ctx context.Context, in *FlushRequest, opts ...grpc.CallOption) (*FlushResponse, error)
// Gets a message from a specific queue using its id
// CAUTION: this should be used mainly for diagnostics and debugging purposes since it will be direct operation on the storage system
GetById(ctx context.Context, in *GetByIdRequest, opts ...grpc.CallOption) (*GetByIdResponse, error)
// Edits a queue configuration
EditQueue(ctx context.Context, in *EditQueueRequest, opts ...grpc.CallOption) (*EditQueueResponse, error)
// Gets the current configuration for a queue
GetQueue(ctx context.Context, in *GetQueueRequest, opts ...grpc.CallOption) (*GetQueueResponse, error)
}
type deckardClient struct {
cc grpc.ClientConnInterface
}
func NewDeckardClient(cc grpc.ClientConnInterface) DeckardClient {
return &deckardClient{cc}
}
func (c *deckardClient) Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AddResponse)
err := c.cc.Invoke(ctx, Deckard_Add_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deckardClient) Pull(ctx context.Context, in *PullRequest, opts ...grpc.CallOption) (*PullResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PullResponse)
err := c.cc.Invoke(ctx, Deckard_Pull_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deckardClient) Ack(ctx context.Context, in *AckRequest, opts ...grpc.CallOption) (*AckResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AckResponse)
err := c.cc.Invoke(ctx, Deckard_Ack_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deckardClient) Nack(ctx context.Context, in *AckRequest, opts ...grpc.CallOption) (*AckResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AckResponse)
err := c.cc.Invoke(ctx, Deckard_Nack_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deckardClient) Count(ctx context.Context, in *CountRequest, opts ...grpc.CallOption) (*CountResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CountResponse)
err := c.cc.Invoke(ctx, Deckard_Count_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deckardClient) Remove(ctx context.Context, in *RemoveRequest, opts ...grpc.CallOption) (*RemoveResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RemoveResponse)
err := c.cc.Invoke(ctx, Deckard_Remove_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deckardClient) Flush(ctx context.Context, in *FlushRequest, opts ...grpc.CallOption) (*FlushResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FlushResponse)
err := c.cc.Invoke(ctx, Deckard_Flush_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deckardClient) GetById(ctx context.Context, in *GetByIdRequest, opts ...grpc.CallOption) (*GetByIdResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetByIdResponse)
err := c.cc.Invoke(ctx, Deckard_GetById_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deckardClient) EditQueue(ctx context.Context, in *EditQueueRequest, opts ...grpc.CallOption) (*EditQueueResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EditQueueResponse)
err := c.cc.Invoke(ctx, Deckard_EditQueue_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deckardClient) GetQueue(ctx context.Context, in *GetQueueRequest, opts ...grpc.CallOption) (*GetQueueResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetQueueResponse)
err := c.cc.Invoke(ctx, Deckard_GetQueue_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// DeckardServer is the server API for Deckard service.
// All implementations must embed UnimplementedDeckardServer
// for forward compatibility.
type DeckardServer interface {
// Adds messages to the queue. If any message already exists (same id and queue) it will be updated
Add(context.Context, *AddRequest) (*AddResponse, error)
// Pulls messages from the queue
Pull(context.Context, *PullRequest) (*PullResponse, error)
// Acks a message, marking it as successfully processed
Ack(context.Context, *AckRequest) (*AckResponse, error)
// Nacks a message, marking it as not processed
Nack(context.Context, *AckRequest) (*AckResponse, error)
// Counts number of messages on queue based on a filter request
Count(context.Context, *CountRequest) (*CountResponse, error)
// Removes one or many messages from the queue based on its ids
Remove(context.Context, *RemoveRequest) (*RemoveResponse, error)
// Discards all deckard data from storage and cache.
// This request is only available if deckard instance is configured with MEMORY cache and storage.
Flush(context.Context, *FlushRequest) (*FlushResponse, error)
// Gets a message from a specific queue using its id
// CAUTION: this should be used mainly for diagnostics and debugging purposes since it will be direct operation on the storage system
GetById(context.Context, *GetByIdRequest) (*GetByIdResponse, error)
// Edits a queue configuration
EditQueue(context.Context, *EditQueueRequest) (*EditQueueResponse, error)
// Gets the current configuration for a queue
GetQueue(context.Context, *GetQueueRequest) (*GetQueueResponse, error)
mustEmbedUnimplementedDeckardServer()
}
// UnimplementedDeckardServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedDeckardServer struct{}
func (UnimplementedDeckardServer) Add(context.Context, *AddRequest) (*AddResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Add not implemented")
}
func (UnimplementedDeckardServer) Pull(context.Context, *PullRequest) (*PullResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Pull not implemented")
}
func (UnimplementedDeckardServer) Ack(context.Context, *AckRequest) (*AckResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ack not implemented")
}
func (UnimplementedDeckardServer) Nack(context.Context, *AckRequest) (*AckResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Nack not implemented")
}
func (UnimplementedDeckardServer) Count(context.Context, *CountRequest) (*CountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Count not implemented")
}
func (UnimplementedDeckardServer) Remove(context.Context, *RemoveRequest) (*RemoveResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented")
}
func (UnimplementedDeckardServer) Flush(context.Context, *FlushRequest) (*FlushResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Flush not implemented")
}
func (UnimplementedDeckardServer) GetById(context.Context, *GetByIdRequest) (*GetByIdResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetById not implemented")
}
func (UnimplementedDeckardServer) EditQueue(context.Context, *EditQueueRequest) (*EditQueueResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method EditQueue not implemented")
}
func (UnimplementedDeckardServer) GetQueue(context.Context, *GetQueueRequest) (*GetQueueResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetQueue not implemented")
}
func (UnimplementedDeckardServer) mustEmbedUnimplementedDeckardServer() {}
func (UnimplementedDeckardServer) testEmbeddedByValue() {}
// UnsafeDeckardServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DeckardServer will
// result in compilation errors.
type UnsafeDeckardServer interface {
mustEmbedUnimplementedDeckardServer()
}
func RegisterDeckardServer(s grpc.ServiceRegistrar, srv DeckardServer) {
// If the following call pancis, it indicates UnimplementedDeckardServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Deckard_ServiceDesc, srv)
}
func _Deckard_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeckardServer).Add(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Deckard_Add_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeckardServer).Add(ctx, req.(*AddRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Deckard_Pull_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PullRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeckardServer).Pull(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Deckard_Pull_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeckardServer).Pull(ctx, req.(*PullRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Deckard_Ack_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AckRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeckardServer).Ack(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Deckard_Ack_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeckardServer).Ack(ctx, req.(*AckRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Deckard_Nack_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AckRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeckardServer).Nack(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Deckard_Nack_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeckardServer).Nack(ctx, req.(*AckRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Deckard_Count_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CountRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeckardServer).Count(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Deckard_Count_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeckardServer).Count(ctx, req.(*CountRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Deckard_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemoveRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeckardServer).Remove(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Deckard_Remove_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeckardServer).Remove(ctx, req.(*RemoveRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Deckard_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FlushRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeckardServer).Flush(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Deckard_Flush_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeckardServer).Flush(ctx, req.(*FlushRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Deckard_GetById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetByIdRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeckardServer).GetById(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Deckard_GetById_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeckardServer).GetById(ctx, req.(*GetByIdRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Deckard_EditQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EditQueueRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeckardServer).EditQueue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Deckard_EditQueue_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeckardServer).EditQueue(ctx, req.(*EditQueueRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Deckard_GetQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetQueueRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeckardServer).GetQueue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Deckard_GetQueue_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeckardServer).GetQueue(ctx, req.(*GetQueueRequest))
}
return interceptor(ctx, in, info, handler)
}
// Deckard_ServiceDesc is the grpc.ServiceDesc for Deckard service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Deckard_ServiceDesc = grpc.ServiceDesc{
ServiceName: "blipai.deckard.Deckard",
HandlerType: (*DeckardServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Add",
Handler: _Deckard_Add_Handler,
},
{
MethodName: "Pull",
Handler: _Deckard_Pull_Handler,
},
{
MethodName: "Ack",
Handler: _Deckard_Ack_Handler,
},
{
MethodName: "Nack",
Handler: _Deckard_Nack_Handler,
},
{
MethodName: "Count",
Handler: _Deckard_Count_Handler,
},
{
MethodName: "Remove",
Handler: _Deckard_Remove_Handler,
},
{
MethodName: "Flush",
Handler: _Deckard_Flush_Handler,
},
{
MethodName: "GetById",
Handler: _Deckard_GetById_Handler,
},
{
MethodName: "EditQueue",
Handler: _Deckard_EditQueue_Handler,
},
{
MethodName: "GetQueue",
Handler: _Deckard_GetQueue_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "deckard_service.proto",
}