-
Notifications
You must be signed in to change notification settings - Fork 1
/
source_grpc.pb.go
489 lines (446 loc) · 17.7 KB
/
source_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
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.23.4
// source: plugin-pb/source/v0/source.proto
package source
import (
context "context"
v0 "github.com/cloudquery/plugin-pb-go/pb/base/v0"
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
const (
Source_GetProtocolVersion_FullMethodName = "/proto.Source/GetProtocolVersion"
Source_GetName_FullMethodName = "/proto.Source/GetName"
Source_GetVersion_FullMethodName = "/proto.Source/GetVersion"
Source_GetTables_FullMethodName = "/proto.Source/GetTables"
Source_GetTablesForSpec_FullMethodName = "/proto.Source/GetTablesForSpec"
Source_GetSyncSummary_FullMethodName = "/proto.Source/GetSyncSummary"
Source_Sync_FullMethodName = "/proto.Source/Sync"
Source_Sync2_FullMethodName = "/proto.Source/Sync2"
Source_GetMetrics_FullMethodName = "/proto.Source/GetMetrics"
)
// SourceClient is the client API for Source 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 SourceClient interface {
// Get the current protocol version of the plugin. This helps
// get the right message about upgrade/downgrade of cli and/or plugin.
// Also, on the cli side it can try to upgrade/downgrade the protocol if cli supports it.
// Depcrecated: use GetSupportedProtocolVersions instead
GetProtocolVersion(ctx context.Context, in *v0.GetProtocolVersion_Request, opts ...grpc.CallOption) (*v0.GetProtocolVersion_Response, error)
// Get the name of the plugin
GetName(ctx context.Context, in *v0.GetName_Request, opts ...grpc.CallOption) (*v0.GetName_Response, error)
// Get the current version of the plugin
GetVersion(ctx context.Context, in *v0.GetVersion_Request, opts ...grpc.CallOption) (*v0.GetVersion_Response, error)
// Get all tables the source plugin supports
GetTables(ctx context.Context, in *GetTables_Request, opts ...grpc.CallOption) (*GetTables_Response, error)
// Get all tables the source plugin supports, optionally filtered by a given spec.
// Introduced in version 2 of the protocol.
GetTablesForSpec(ctx context.Context, in *GetTablesForSpec_Request, opts ...grpc.CallOption) (*GetTablesForSpec_Response, error)
// GetSyncSummary returns the latest sync summary of the source plugin. we don't want to send the summary on
// every sync request.
GetSyncSummary(ctx context.Context, in *GetSyncSummary_Request, opts ...grpc.CallOption) (*GetSyncSummary_Response, error)
// Fetch resources
Sync(ctx context.Context, in *Sync_Request, opts ...grpc.CallOption) (Source_SyncClient, error)
// Sync2 is a new sync API that supports CQ Types. It is not backward compatible with Sync.
Sync2(ctx context.Context, in *Sync2_Request, opts ...grpc.CallOption) (Source_Sync2Client, error)
// Get metrics for the source plugin
GetMetrics(ctx context.Context, in *GetSourceMetrics_Request, opts ...grpc.CallOption) (*GetSourceMetrics_Response, error)
}
type sourceClient struct {
cc grpc.ClientConnInterface
}
func NewSourceClient(cc grpc.ClientConnInterface) SourceClient {
return &sourceClient{cc}
}
func (c *sourceClient) GetProtocolVersion(ctx context.Context, in *v0.GetProtocolVersion_Request, opts ...grpc.CallOption) (*v0.GetProtocolVersion_Response, error) {
out := new(v0.GetProtocolVersion_Response)
err := c.cc.Invoke(ctx, Source_GetProtocolVersion_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sourceClient) GetName(ctx context.Context, in *v0.GetName_Request, opts ...grpc.CallOption) (*v0.GetName_Response, error) {
out := new(v0.GetName_Response)
err := c.cc.Invoke(ctx, Source_GetName_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sourceClient) GetVersion(ctx context.Context, in *v0.GetVersion_Request, opts ...grpc.CallOption) (*v0.GetVersion_Response, error) {
out := new(v0.GetVersion_Response)
err := c.cc.Invoke(ctx, Source_GetVersion_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sourceClient) GetTables(ctx context.Context, in *GetTables_Request, opts ...grpc.CallOption) (*GetTables_Response, error) {
out := new(GetTables_Response)
err := c.cc.Invoke(ctx, Source_GetTables_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sourceClient) GetTablesForSpec(ctx context.Context, in *GetTablesForSpec_Request, opts ...grpc.CallOption) (*GetTablesForSpec_Response, error) {
out := new(GetTablesForSpec_Response)
err := c.cc.Invoke(ctx, Source_GetTablesForSpec_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sourceClient) GetSyncSummary(ctx context.Context, in *GetSyncSummary_Request, opts ...grpc.CallOption) (*GetSyncSummary_Response, error) {
out := new(GetSyncSummary_Response)
err := c.cc.Invoke(ctx, Source_GetSyncSummary_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sourceClient) Sync(ctx context.Context, in *Sync_Request, opts ...grpc.CallOption) (Source_SyncClient, error) {
stream, err := c.cc.NewStream(ctx, &Source_ServiceDesc.Streams[0], Source_Sync_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &sourceSyncClient{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 Source_SyncClient interface {
Recv() (*Sync_Response, error)
grpc.ClientStream
}
type sourceSyncClient struct {
grpc.ClientStream
}
func (x *sourceSyncClient) Recv() (*Sync_Response, error) {
m := new(Sync_Response)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *sourceClient) Sync2(ctx context.Context, in *Sync2_Request, opts ...grpc.CallOption) (Source_Sync2Client, error) {
stream, err := c.cc.NewStream(ctx, &Source_ServiceDesc.Streams[1], Source_Sync2_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &sourceSync2Client{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 Source_Sync2Client interface {
Recv() (*Sync2_Response, error)
grpc.ClientStream
}
type sourceSync2Client struct {
grpc.ClientStream
}
func (x *sourceSync2Client) Recv() (*Sync2_Response, error) {
m := new(Sync2_Response)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *sourceClient) GetMetrics(ctx context.Context, in *GetSourceMetrics_Request, opts ...grpc.CallOption) (*GetSourceMetrics_Response, error) {
out := new(GetSourceMetrics_Response)
err := c.cc.Invoke(ctx, Source_GetMetrics_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// SourceServer is the server API for Source service.
// All implementations must embed UnimplementedSourceServer
// for forward compatibility
type SourceServer interface {
// Get the current protocol version of the plugin. This helps
// get the right message about upgrade/downgrade of cli and/or plugin.
// Also, on the cli side it can try to upgrade/downgrade the protocol if cli supports it.
// Depcrecated: use GetSupportedProtocolVersions instead
GetProtocolVersion(context.Context, *v0.GetProtocolVersion_Request) (*v0.GetProtocolVersion_Response, error)
// Get the name of the plugin
GetName(context.Context, *v0.GetName_Request) (*v0.GetName_Response, error)
// Get the current version of the plugin
GetVersion(context.Context, *v0.GetVersion_Request) (*v0.GetVersion_Response, error)
// Get all tables the source plugin supports
GetTables(context.Context, *GetTables_Request) (*GetTables_Response, error)
// Get all tables the source plugin supports, optionally filtered by a given spec.
// Introduced in version 2 of the protocol.
GetTablesForSpec(context.Context, *GetTablesForSpec_Request) (*GetTablesForSpec_Response, error)
// GetSyncSummary returns the latest sync summary of the source plugin. we don't want to send the summary on
// every sync request.
GetSyncSummary(context.Context, *GetSyncSummary_Request) (*GetSyncSummary_Response, error)
// Fetch resources
Sync(*Sync_Request, Source_SyncServer) error
// Sync2 is a new sync API that supports CQ Types. It is not backward compatible with Sync.
Sync2(*Sync2_Request, Source_Sync2Server) error
// Get metrics for the source plugin
GetMetrics(context.Context, *GetSourceMetrics_Request) (*GetSourceMetrics_Response, error)
mustEmbedUnimplementedSourceServer()
}
// UnimplementedSourceServer must be embedded to have forward compatible implementations.
type UnimplementedSourceServer struct {
}
func (UnimplementedSourceServer) GetProtocolVersion(context.Context, *v0.GetProtocolVersion_Request) (*v0.GetProtocolVersion_Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetProtocolVersion not implemented")
}
func (UnimplementedSourceServer) GetName(context.Context, *v0.GetName_Request) (*v0.GetName_Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetName not implemented")
}
func (UnimplementedSourceServer) GetVersion(context.Context, *v0.GetVersion_Request) (*v0.GetVersion_Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented")
}
func (UnimplementedSourceServer) GetTables(context.Context, *GetTables_Request) (*GetTables_Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetTables not implemented")
}
func (UnimplementedSourceServer) GetTablesForSpec(context.Context, *GetTablesForSpec_Request) (*GetTablesForSpec_Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetTablesForSpec not implemented")
}
func (UnimplementedSourceServer) GetSyncSummary(context.Context, *GetSyncSummary_Request) (*GetSyncSummary_Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSyncSummary not implemented")
}
func (UnimplementedSourceServer) Sync(*Sync_Request, Source_SyncServer) error {
return status.Errorf(codes.Unimplemented, "method Sync not implemented")
}
func (UnimplementedSourceServer) Sync2(*Sync2_Request, Source_Sync2Server) error {
return status.Errorf(codes.Unimplemented, "method Sync2 not implemented")
}
func (UnimplementedSourceServer) GetMetrics(context.Context, *GetSourceMetrics_Request) (*GetSourceMetrics_Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetMetrics not implemented")
}
func (UnimplementedSourceServer) mustEmbedUnimplementedSourceServer() {}
// UnsafeSourceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SourceServer will
// result in compilation errors.
type UnsafeSourceServer interface {
mustEmbedUnimplementedSourceServer()
}
func RegisterSourceServer(s grpc.ServiceRegistrar, srv SourceServer) {
s.RegisterService(&Source_ServiceDesc, srv)
}
func _Source_GetProtocolVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v0.GetProtocolVersion_Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SourceServer).GetProtocolVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Source_GetProtocolVersion_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SourceServer).GetProtocolVersion(ctx, req.(*v0.GetProtocolVersion_Request))
}
return interceptor(ctx, in, info, handler)
}
func _Source_GetName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v0.GetName_Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SourceServer).GetName(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Source_GetName_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SourceServer).GetName(ctx, req.(*v0.GetName_Request))
}
return interceptor(ctx, in, info, handler)
}
func _Source_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v0.GetVersion_Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SourceServer).GetVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Source_GetVersion_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SourceServer).GetVersion(ctx, req.(*v0.GetVersion_Request))
}
return interceptor(ctx, in, info, handler)
}
func _Source_GetTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetTables_Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SourceServer).GetTables(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Source_GetTables_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SourceServer).GetTables(ctx, req.(*GetTables_Request))
}
return interceptor(ctx, in, info, handler)
}
func _Source_GetTablesForSpec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetTablesForSpec_Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SourceServer).GetTablesForSpec(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Source_GetTablesForSpec_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SourceServer).GetTablesForSpec(ctx, req.(*GetTablesForSpec_Request))
}
return interceptor(ctx, in, info, handler)
}
func _Source_GetSyncSummary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetSyncSummary_Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SourceServer).GetSyncSummary(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Source_GetSyncSummary_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SourceServer).GetSyncSummary(ctx, req.(*GetSyncSummary_Request))
}
return interceptor(ctx, in, info, handler)
}
func _Source_Sync_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(Sync_Request)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(SourceServer).Sync(m, &sourceSyncServer{stream})
}
type Source_SyncServer interface {
Send(*Sync_Response) error
grpc.ServerStream
}
type sourceSyncServer struct {
grpc.ServerStream
}
func (x *sourceSyncServer) Send(m *Sync_Response) error {
return x.ServerStream.SendMsg(m)
}
func _Source_Sync2_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(Sync2_Request)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(SourceServer).Sync2(m, &sourceSync2Server{stream})
}
type Source_Sync2Server interface {
Send(*Sync2_Response) error
grpc.ServerStream
}
type sourceSync2Server struct {
grpc.ServerStream
}
func (x *sourceSync2Server) Send(m *Sync2_Response) error {
return x.ServerStream.SendMsg(m)
}
func _Source_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetSourceMetrics_Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SourceServer).GetMetrics(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Source_GetMetrics_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SourceServer).GetMetrics(ctx, req.(*GetSourceMetrics_Request))
}
return interceptor(ctx, in, info, handler)
}
// Source_ServiceDesc is the grpc.ServiceDesc for Source service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Source_ServiceDesc = grpc.ServiceDesc{
ServiceName: "proto.Source",
HandlerType: (*SourceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetProtocolVersion",
Handler: _Source_GetProtocolVersion_Handler,
},
{
MethodName: "GetName",
Handler: _Source_GetName_Handler,
},
{
MethodName: "GetVersion",
Handler: _Source_GetVersion_Handler,
},
{
MethodName: "GetTables",
Handler: _Source_GetTables_Handler,
},
{
MethodName: "GetTablesForSpec",
Handler: _Source_GetTablesForSpec_Handler,
},
{
MethodName: "GetSyncSummary",
Handler: _Source_GetSyncSummary_Handler,
},
{
MethodName: "GetMetrics",
Handler: _Source_GetMetrics_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Sync",
Handler: _Source_Sync_Handler,
ServerStreams: true,
},
{
StreamName: "Sync2",
Handler: _Source_Sync2_Handler,
ServerStreams: true,
},
},
Metadata: "plugin-pb/source/v0/source.proto",
}