-
Notifications
You must be signed in to change notification settings - Fork 0
/
loan_grpc.pb.go
469 lines (428 loc) · 17.7 KB
/
loan_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
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package loan
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion7
// LoanProductAPIClient is the client API for LoanProductAPI 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 LoanProductAPIClient interface {
CreateLoanProduct(ctx context.Context, in *CreateLoanProductRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
UpdateLoanProduct(ctx context.Context, in *UpdateLoanProductRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
DeleteLoanProduct(ctx context.Context, in *DeleteLoanProductRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
ListLoanProducts(ctx context.Context, in *ListLoanProductsRequest, opts ...grpc.CallOption) (*ListLoanProductsResponse, error)
GetLoanProduct(ctx context.Context, in *GetLoanProductRequest, opts ...grpc.CallOption) (*LoanProduct, error)
}
type loanProductAPIClient struct {
cc grpc.ClientConnInterface
}
func NewLoanProductAPIClient(cc grpc.ClientConnInterface) LoanProductAPIClient {
return &loanProductAPIClient{cc}
}
func (c *loanProductAPIClient) CreateLoanProduct(ctx context.Context, in *CreateLoanProductRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/gidyon.loan.LoanProductAPI/CreateLoanProduct", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loanProductAPIClient) UpdateLoanProduct(ctx context.Context, in *UpdateLoanProductRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/gidyon.loan.LoanProductAPI/UpdateLoanProduct", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loanProductAPIClient) DeleteLoanProduct(ctx context.Context, in *DeleteLoanProductRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/gidyon.loan.LoanProductAPI/DeleteLoanProduct", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loanProductAPIClient) ListLoanProducts(ctx context.Context, in *ListLoanProductsRequest, opts ...grpc.CallOption) (*ListLoanProductsResponse, error) {
out := new(ListLoanProductsResponse)
err := c.cc.Invoke(ctx, "/gidyon.loan.LoanProductAPI/ListLoanProducts", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loanProductAPIClient) GetLoanProduct(ctx context.Context, in *GetLoanProductRequest, opts ...grpc.CallOption) (*LoanProduct, error) {
out := new(LoanProduct)
err := c.cc.Invoke(ctx, "/gidyon.loan.LoanProductAPI/GetLoanProduct", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// LoanProductAPIServer is the server API for LoanProductAPI service.
// All implementations must embed UnimplementedLoanProductAPIServer
// for forward compatibility
type LoanProductAPIServer interface {
CreateLoanProduct(context.Context, *CreateLoanProductRequest) (*emptypb.Empty, error)
UpdateLoanProduct(context.Context, *UpdateLoanProductRequest) (*emptypb.Empty, error)
DeleteLoanProduct(context.Context, *DeleteLoanProductRequest) (*emptypb.Empty, error)
ListLoanProducts(context.Context, *ListLoanProductsRequest) (*ListLoanProductsResponse, error)
GetLoanProduct(context.Context, *GetLoanProductRequest) (*LoanProduct, error)
mustEmbedUnimplementedLoanProductAPIServer()
}
// UnimplementedLoanProductAPIServer must be embedded to have forward compatible implementations.
type UnimplementedLoanProductAPIServer struct {
}
func (UnimplementedLoanProductAPIServer) CreateLoanProduct(context.Context, *CreateLoanProductRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateLoanProduct not implemented")
}
func (UnimplementedLoanProductAPIServer) UpdateLoanProduct(context.Context, *UpdateLoanProductRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateLoanProduct not implemented")
}
func (UnimplementedLoanProductAPIServer) DeleteLoanProduct(context.Context, *DeleteLoanProductRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteLoanProduct not implemented")
}
func (UnimplementedLoanProductAPIServer) ListLoanProducts(context.Context, *ListLoanProductsRequest) (*ListLoanProductsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListLoanProducts not implemented")
}
func (UnimplementedLoanProductAPIServer) GetLoanProduct(context.Context, *GetLoanProductRequest) (*LoanProduct, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetLoanProduct not implemented")
}
func (UnimplementedLoanProductAPIServer) mustEmbedUnimplementedLoanProductAPIServer() {}
// UnsafeLoanProductAPIServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to LoanProductAPIServer will
// result in compilation errors.
type UnsafeLoanProductAPIServer interface {
mustEmbedUnimplementedLoanProductAPIServer()
}
func RegisterLoanProductAPIServer(s grpc.ServiceRegistrar, srv LoanProductAPIServer) {
s.RegisterService(&_LoanProductAPI_serviceDesc, srv)
}
func _LoanProductAPI_CreateLoanProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateLoanProductRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoanProductAPIServer).CreateLoanProduct(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gidyon.loan.LoanProductAPI/CreateLoanProduct",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoanProductAPIServer).CreateLoanProduct(ctx, req.(*CreateLoanProductRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoanProductAPI_UpdateLoanProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateLoanProductRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoanProductAPIServer).UpdateLoanProduct(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gidyon.loan.LoanProductAPI/UpdateLoanProduct",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoanProductAPIServer).UpdateLoanProduct(ctx, req.(*UpdateLoanProductRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoanProductAPI_DeleteLoanProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteLoanProductRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoanProductAPIServer).DeleteLoanProduct(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gidyon.loan.LoanProductAPI/DeleteLoanProduct",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoanProductAPIServer).DeleteLoanProduct(ctx, req.(*DeleteLoanProductRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoanProductAPI_ListLoanProducts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListLoanProductsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoanProductAPIServer).ListLoanProducts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gidyon.loan.LoanProductAPI/ListLoanProducts",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoanProductAPIServer).ListLoanProducts(ctx, req.(*ListLoanProductsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoanProductAPI_GetLoanProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetLoanProductRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoanProductAPIServer).GetLoanProduct(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gidyon.loan.LoanProductAPI/GetLoanProduct",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoanProductAPIServer).GetLoanProduct(ctx, req.(*GetLoanProductRequest))
}
return interceptor(ctx, in, info, handler)
}
var _LoanProductAPI_serviceDesc = grpc.ServiceDesc{
ServiceName: "gidyon.loan.LoanProductAPI",
HandlerType: (*LoanProductAPIServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateLoanProduct",
Handler: _LoanProductAPI_CreateLoanProduct_Handler,
},
{
MethodName: "UpdateLoanProduct",
Handler: _LoanProductAPI_UpdateLoanProduct_Handler,
},
{
MethodName: "DeleteLoanProduct",
Handler: _LoanProductAPI_DeleteLoanProduct_Handler,
},
{
MethodName: "ListLoanProducts",
Handler: _LoanProductAPI_ListLoanProducts_Handler,
},
{
MethodName: "GetLoanProduct",
Handler: _LoanProductAPI_GetLoanProduct_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "loan.proto",
}
// LoanAPIClient is the client API for LoanAPI 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 LoanAPIClient interface {
CreateLoan(ctx context.Context, in *CreateLoanRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
UpdateLoan(ctx context.Context, in *UpdateLoanRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
ListLoans(ctx context.Context, in *ListLoansRequest, opts ...grpc.CallOption) (*ListLoansResponse, error)
GetLoan(ctx context.Context, in *GetLoanRequest, opts ...grpc.CallOption) (*Loan, error)
ApproveLoan(ctx context.Context, in *ApproveLoanRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type loanAPIClient struct {
cc grpc.ClientConnInterface
}
func NewLoanAPIClient(cc grpc.ClientConnInterface) LoanAPIClient {
return &loanAPIClient{cc}
}
func (c *loanAPIClient) CreateLoan(ctx context.Context, in *CreateLoanRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/gidyon.loan.LoanAPI/CreateLoan", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loanAPIClient) UpdateLoan(ctx context.Context, in *UpdateLoanRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/gidyon.loan.LoanAPI/UpdateLoan", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loanAPIClient) ListLoans(ctx context.Context, in *ListLoansRequest, opts ...grpc.CallOption) (*ListLoansResponse, error) {
out := new(ListLoansResponse)
err := c.cc.Invoke(ctx, "/gidyon.loan.LoanAPI/ListLoans", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loanAPIClient) GetLoan(ctx context.Context, in *GetLoanRequest, opts ...grpc.CallOption) (*Loan, error) {
out := new(Loan)
err := c.cc.Invoke(ctx, "/gidyon.loan.LoanAPI/GetLoan", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *loanAPIClient) ApproveLoan(ctx context.Context, in *ApproveLoanRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/gidyon.loan.LoanAPI/ApproveLoan", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// LoanAPIServer is the server API for LoanAPI service.
// All implementations must embed UnimplementedLoanAPIServer
// for forward compatibility
type LoanAPIServer interface {
CreateLoan(context.Context, *CreateLoanRequest) (*emptypb.Empty, error)
UpdateLoan(context.Context, *UpdateLoanRequest) (*emptypb.Empty, error)
ListLoans(context.Context, *ListLoansRequest) (*ListLoansResponse, error)
GetLoan(context.Context, *GetLoanRequest) (*Loan, error)
ApproveLoan(context.Context, *ApproveLoanRequest) (*emptypb.Empty, error)
mustEmbedUnimplementedLoanAPIServer()
}
// UnimplementedLoanAPIServer must be embedded to have forward compatible implementations.
type UnimplementedLoanAPIServer struct {
}
func (UnimplementedLoanAPIServer) CreateLoan(context.Context, *CreateLoanRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateLoan not implemented")
}
func (UnimplementedLoanAPIServer) UpdateLoan(context.Context, *UpdateLoanRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateLoan not implemented")
}
func (UnimplementedLoanAPIServer) ListLoans(context.Context, *ListLoansRequest) (*ListLoansResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListLoans not implemented")
}
func (UnimplementedLoanAPIServer) GetLoan(context.Context, *GetLoanRequest) (*Loan, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetLoan not implemented")
}
func (UnimplementedLoanAPIServer) ApproveLoan(context.Context, *ApproveLoanRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ApproveLoan not implemented")
}
func (UnimplementedLoanAPIServer) mustEmbedUnimplementedLoanAPIServer() {}
// UnsafeLoanAPIServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to LoanAPIServer will
// result in compilation errors.
type UnsafeLoanAPIServer interface {
mustEmbedUnimplementedLoanAPIServer()
}
func RegisterLoanAPIServer(s grpc.ServiceRegistrar, srv LoanAPIServer) {
s.RegisterService(&_LoanAPI_serviceDesc, srv)
}
func _LoanAPI_CreateLoan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateLoanRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoanAPIServer).CreateLoan(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gidyon.loan.LoanAPI/CreateLoan",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoanAPIServer).CreateLoan(ctx, req.(*CreateLoanRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoanAPI_UpdateLoan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateLoanRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoanAPIServer).UpdateLoan(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gidyon.loan.LoanAPI/UpdateLoan",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoanAPIServer).UpdateLoan(ctx, req.(*UpdateLoanRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoanAPI_ListLoans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListLoansRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoanAPIServer).ListLoans(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gidyon.loan.LoanAPI/ListLoans",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoanAPIServer).ListLoans(ctx, req.(*ListLoansRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoanAPI_GetLoan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetLoanRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoanAPIServer).GetLoan(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gidyon.loan.LoanAPI/GetLoan",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoanAPIServer).GetLoan(ctx, req.(*GetLoanRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LoanAPI_ApproveLoan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ApproveLoanRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LoanAPIServer).ApproveLoan(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/gidyon.loan.LoanAPI/ApproveLoan",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LoanAPIServer).ApproveLoan(ctx, req.(*ApproveLoanRequest))
}
return interceptor(ctx, in, info, handler)
}
var _LoanAPI_serviceDesc = grpc.ServiceDesc{
ServiceName: "gidyon.loan.LoanAPI",
HandlerType: (*LoanAPIServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateLoan",
Handler: _LoanAPI_CreateLoan_Handler,
},
{
MethodName: "UpdateLoan",
Handler: _LoanAPI_UpdateLoan_Handler,
},
{
MethodName: "ListLoans",
Handler: _LoanAPI_ListLoans_Handler,
},
{
MethodName: "GetLoan",
Handler: _LoanAPI_GetLoan_Handler,
},
{
MethodName: "ApproveLoan",
Handler: _LoanAPI_ApproveLoan_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "loan.proto",
}