-
Notifications
You must be signed in to change notification settings - Fork 103
/
query_grpc.pb.go
377 lines (349 loc) · 14.4 KB
/
query_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
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc (unknown)
// source: regen/ecocredit/v1alpha1/query.proto
package ecocreditv1alpha1
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
// QueryClient is the client API for Query 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 QueryClient interface {
// Classes queries for all credit classes with pagination.
Classes(ctx context.Context, in *QueryClassesRequest, opts ...grpc.CallOption) (*QueryClassesResponse, error)
// ClassInfo queries for information on a credit class.
ClassInfo(ctx context.Context, in *QueryClassInfoRequest, opts ...grpc.CallOption) (*QueryClassInfoResponse, error)
// Batches queries for all batches in the given credit class with pagination.
Batches(ctx context.Context, in *QueryBatchesRequest, opts ...grpc.CallOption) (*QueryBatchesResponse, error)
// BatchInfo queries for information on a credit batch.
BatchInfo(ctx context.Context, in *QueryBatchInfoRequest, opts ...grpc.CallOption) (*QueryBatchInfoResponse, error)
// Balance queries the balance (both tradable and retired) of a given credit
// batch for a given account.
Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error)
// Supply queries the tradable and retired supply of a credit batch.
Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error)
// CreditTypes returns the list of allowed types that credit classes can have.
// See Types/CreditType for more details.
CreditTypes(ctx context.Context, in *QueryCreditTypesRequest, opts ...grpc.CallOption) (*QueryCreditTypesResponse, error)
// Params queries the ecocredit module parameters.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
}
type queryClient struct {
cc grpc.ClientConnInterface
}
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
return &queryClient{cc}
}
func (c *queryClient) Classes(ctx context.Context, in *QueryClassesRequest, opts ...grpc.CallOption) (*QueryClassesResponse, error) {
out := new(QueryClassesResponse)
err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/Classes", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) ClassInfo(ctx context.Context, in *QueryClassInfoRequest, opts ...grpc.CallOption) (*QueryClassInfoResponse, error) {
out := new(QueryClassInfoResponse)
err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/ClassInfo", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Batches(ctx context.Context, in *QueryBatchesRequest, opts ...grpc.CallOption) (*QueryBatchesResponse, error) {
out := new(QueryBatchesResponse)
err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/Batches", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) BatchInfo(ctx context.Context, in *QueryBatchInfoRequest, opts ...grpc.CallOption) (*QueryBatchInfoResponse, error) {
out := new(QueryBatchInfoResponse)
err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/BatchInfo", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) {
out := new(QueryBalanceResponse)
err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/Balance", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) {
out := new(QuerySupplyResponse)
err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/Supply", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) CreditTypes(ctx context.Context, in *QueryCreditTypesRequest, opts ...grpc.CallOption) (*QueryCreditTypesResponse, error) {
out := new(QueryCreditTypesResponse)
err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/CreditTypes", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
out := new(QueryParamsResponse)
err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/Params", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// QueryServer is the server API for Query service.
// All implementations must embed UnimplementedQueryServer
// for forward compatibility
type QueryServer interface {
// Classes queries for all credit classes with pagination.
Classes(context.Context, *QueryClassesRequest) (*QueryClassesResponse, error)
// ClassInfo queries for information on a credit class.
ClassInfo(context.Context, *QueryClassInfoRequest) (*QueryClassInfoResponse, error)
// Batches queries for all batches in the given credit class with pagination.
Batches(context.Context, *QueryBatchesRequest) (*QueryBatchesResponse, error)
// BatchInfo queries for information on a credit batch.
BatchInfo(context.Context, *QueryBatchInfoRequest) (*QueryBatchInfoResponse, error)
// Balance queries the balance (both tradable and retired) of a given credit
// batch for a given account.
Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error)
// Supply queries the tradable and retired supply of a credit batch.
Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error)
// CreditTypes returns the list of allowed types that credit classes can have.
// See Types/CreditType for more details.
CreditTypes(context.Context, *QueryCreditTypesRequest) (*QueryCreditTypesResponse, error)
// Params queries the ecocredit module parameters.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
mustEmbedUnimplementedQueryServer()
}
// UnimplementedQueryServer must be embedded to have forward compatible implementations.
type UnimplementedQueryServer struct {
}
func (UnimplementedQueryServer) Classes(context.Context, *QueryClassesRequest) (*QueryClassesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Classes not implemented")
}
func (UnimplementedQueryServer) ClassInfo(context.Context, *QueryClassInfoRequest) (*QueryClassInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ClassInfo not implemented")
}
func (UnimplementedQueryServer) Batches(context.Context, *QueryBatchesRequest) (*QueryBatchesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Batches not implemented")
}
func (UnimplementedQueryServer) BatchInfo(context.Context, *QueryBatchInfoRequest) (*QueryBatchInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BatchInfo not implemented")
}
func (UnimplementedQueryServer) Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented")
}
func (UnimplementedQueryServer) Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Supply not implemented")
}
func (UnimplementedQueryServer) CreditTypes(context.Context, *QueryCreditTypesRequest) (*QueryCreditTypesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreditTypes not implemented")
}
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
}
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to QueryServer will
// result in compilation errors.
type UnsafeQueryServer interface {
mustEmbedUnimplementedQueryServer()
}
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
s.RegisterService(&Query_ServiceDesc, srv)
}
func _Query_Classes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryClassesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Classes(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/regen.ecocredit.v1alpha1.Query/Classes",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Classes(ctx, req.(*QueryClassesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_ClassInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryClassInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).ClassInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/regen.ecocredit.v1alpha1.Query/ClassInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ClassInfo(ctx, req.(*QueryClassInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Batches_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryBatchesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Batches(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/regen.ecocredit.v1alpha1.Query/Batches",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Batches(ctx, req.(*QueryBatchesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_BatchInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryBatchInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).BatchInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/regen.ecocredit.v1alpha1.Query/BatchInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).BatchInfo(ctx, req.(*QueryBatchInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryBalanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Balance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/regen.ecocredit.v1alpha1.Query/Balance",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Balance(ctx, req.(*QueryBalanceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Supply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QuerySupplyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Supply(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/regen.ecocredit.v1alpha1.Query/Supply",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Supply(ctx, req.(*QuerySupplyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_CreditTypes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryCreditTypesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).CreditTypes(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/regen.ecocredit.v1alpha1.Query/CreditTypes",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).CreditTypes(ctx, req.(*QueryCreditTypesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryParamsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Params(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/regen.ecocredit.v1alpha1.Query/Params",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
}
return interceptor(ctx, in, info, handler)
}
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Query_ServiceDesc = grpc.ServiceDesc{
ServiceName: "regen.ecocredit.v1alpha1.Query",
HandlerType: (*QueryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Classes",
Handler: _Query_Classes_Handler,
},
{
MethodName: "ClassInfo",
Handler: _Query_ClassInfo_Handler,
},
{
MethodName: "Batches",
Handler: _Query_Batches_Handler,
},
{
MethodName: "BatchInfo",
Handler: _Query_BatchInfo_Handler,
},
{
MethodName: "Balance",
Handler: _Query_Balance_Handler,
},
{
MethodName: "Supply",
Handler: _Query_Supply_Handler,
},
{
MethodName: "CreditTypes",
Handler: _Query_CreditTypes_Handler,
},
{
MethodName: "Params",
Handler: _Query_Params_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "regen/ecocredit/v1alpha1/query.proto",
}