-
-
Notifications
You must be signed in to change notification settings - Fork 296
/
bbgo_grpc.pb.go
510 lines (452 loc) · 18.3 KB
/
bbgo_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
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package pb
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
// MarketDataServiceClient is the client API for MarketDataService 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 MarketDataServiceClient interface {
Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (MarketDataService_SubscribeClient, error)
QueryKLines(ctx context.Context, in *QueryKLinesRequest, opts ...grpc.CallOption) (*QueryKLinesResponse, error)
}
type marketDataServiceClient struct {
cc grpc.ClientConnInterface
}
func NewMarketDataServiceClient(cc grpc.ClientConnInterface) MarketDataServiceClient {
return &marketDataServiceClient{cc}
}
func (c *marketDataServiceClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (MarketDataService_SubscribeClient, error) {
stream, err := c.cc.NewStream(ctx, &MarketDataService_ServiceDesc.Streams[0], "/bbgo.MarketDataService/Subscribe", opts...)
if err != nil {
return nil, err
}
x := &marketDataServiceSubscribeClient{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 MarketDataService_SubscribeClient interface {
Recv() (*MarketData, error)
grpc.ClientStream
}
type marketDataServiceSubscribeClient struct {
grpc.ClientStream
}
func (x *marketDataServiceSubscribeClient) Recv() (*MarketData, error) {
m := new(MarketData)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *marketDataServiceClient) QueryKLines(ctx context.Context, in *QueryKLinesRequest, opts ...grpc.CallOption) (*QueryKLinesResponse, error) {
out := new(QueryKLinesResponse)
err := c.cc.Invoke(ctx, "/bbgo.MarketDataService/QueryKLines", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// MarketDataServiceServer is the server API for MarketDataService service.
// All implementations must embed UnimplementedMarketDataServiceServer
// for forward compatibility
type MarketDataServiceServer interface {
Subscribe(*SubscribeRequest, MarketDataService_SubscribeServer) error
QueryKLines(context.Context, *QueryKLinesRequest) (*QueryKLinesResponse, error)
mustEmbedUnimplementedMarketDataServiceServer()
}
// UnimplementedMarketDataServiceServer must be embedded to have forward compatible implementations.
type UnimplementedMarketDataServiceServer struct {
}
func (UnimplementedMarketDataServiceServer) Subscribe(*SubscribeRequest, MarketDataService_SubscribeServer) error {
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
}
func (UnimplementedMarketDataServiceServer) QueryKLines(context.Context, *QueryKLinesRequest) (*QueryKLinesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueryKLines not implemented")
}
func (UnimplementedMarketDataServiceServer) mustEmbedUnimplementedMarketDataServiceServer() {}
// UnsafeMarketDataServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MarketDataServiceServer will
// result in compilation errors.
type UnsafeMarketDataServiceServer interface {
mustEmbedUnimplementedMarketDataServiceServer()
}
func RegisterMarketDataServiceServer(s grpc.ServiceRegistrar, srv MarketDataServiceServer) {
s.RegisterService(&MarketDataService_ServiceDesc, srv)
}
func _MarketDataService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SubscribeRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(MarketDataServiceServer).Subscribe(m, &marketDataServiceSubscribeServer{stream})
}
type MarketDataService_SubscribeServer interface {
Send(*MarketData) error
grpc.ServerStream
}
type marketDataServiceSubscribeServer struct {
grpc.ServerStream
}
func (x *marketDataServiceSubscribeServer) Send(m *MarketData) error {
return x.ServerStream.SendMsg(m)
}
func _MarketDataService_QueryKLines_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryKLinesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MarketDataServiceServer).QueryKLines(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/bbgo.MarketDataService/QueryKLines",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MarketDataServiceServer).QueryKLines(ctx, req.(*QueryKLinesRequest))
}
return interceptor(ctx, in, info, handler)
}
// MarketDataService_ServiceDesc is the grpc.ServiceDesc for MarketDataService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var MarketDataService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "bbgo.MarketDataService",
HandlerType: (*MarketDataServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "QueryKLines",
Handler: _MarketDataService_QueryKLines_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Subscribe",
Handler: _MarketDataService_Subscribe_Handler,
ServerStreams: true,
},
},
Metadata: "pkg/pb/bbgo.proto",
}
// UserDataServiceClient is the client API for UserDataService 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 UserDataServiceClient interface {
Subscribe(ctx context.Context, in *UserDataRequest, opts ...grpc.CallOption) (UserDataService_SubscribeClient, error)
}
type userDataServiceClient struct {
cc grpc.ClientConnInterface
}
func NewUserDataServiceClient(cc grpc.ClientConnInterface) UserDataServiceClient {
return &userDataServiceClient{cc}
}
func (c *userDataServiceClient) Subscribe(ctx context.Context, in *UserDataRequest, opts ...grpc.CallOption) (UserDataService_SubscribeClient, error) {
stream, err := c.cc.NewStream(ctx, &UserDataService_ServiceDesc.Streams[0], "/bbgo.UserDataService/Subscribe", opts...)
if err != nil {
return nil, err
}
x := &userDataServiceSubscribeClient{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 UserDataService_SubscribeClient interface {
Recv() (*UserData, error)
grpc.ClientStream
}
type userDataServiceSubscribeClient struct {
grpc.ClientStream
}
func (x *userDataServiceSubscribeClient) Recv() (*UserData, error) {
m := new(UserData)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// UserDataServiceServer is the server API for UserDataService service.
// All implementations must embed UnimplementedUserDataServiceServer
// for forward compatibility
type UserDataServiceServer interface {
Subscribe(*UserDataRequest, UserDataService_SubscribeServer) error
mustEmbedUnimplementedUserDataServiceServer()
}
// UnimplementedUserDataServiceServer must be embedded to have forward compatible implementations.
type UnimplementedUserDataServiceServer struct {
}
func (UnimplementedUserDataServiceServer) Subscribe(*UserDataRequest, UserDataService_SubscribeServer) error {
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
}
func (UnimplementedUserDataServiceServer) mustEmbedUnimplementedUserDataServiceServer() {}
// UnsafeUserDataServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserDataServiceServer will
// result in compilation errors.
type UnsafeUserDataServiceServer interface {
mustEmbedUnimplementedUserDataServiceServer()
}
func RegisterUserDataServiceServer(s grpc.ServiceRegistrar, srv UserDataServiceServer) {
s.RegisterService(&UserDataService_ServiceDesc, srv)
}
func _UserDataService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(UserDataRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(UserDataServiceServer).Subscribe(m, &userDataServiceSubscribeServer{stream})
}
type UserDataService_SubscribeServer interface {
Send(*UserData) error
grpc.ServerStream
}
type userDataServiceSubscribeServer struct {
grpc.ServerStream
}
func (x *userDataServiceSubscribeServer) Send(m *UserData) error {
return x.ServerStream.SendMsg(m)
}
// UserDataService_ServiceDesc is the grpc.ServiceDesc for UserDataService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UserDataService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "bbgo.UserDataService",
HandlerType: (*UserDataServiceServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "Subscribe",
Handler: _UserDataService_Subscribe_Handler,
ServerStreams: true,
},
},
Metadata: "pkg/pb/bbgo.proto",
}
// TradingServiceClient is the client API for TradingService 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 TradingServiceClient interface {
// request-response
SubmitOrder(ctx context.Context, in *SubmitOrderRequest, opts ...grpc.CallOption) (*SubmitOrderResponse, error)
CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*CancelOrderResponse, error)
QueryOrder(ctx context.Context, in *QueryOrderRequest, opts ...grpc.CallOption) (*QueryOrderResponse, error)
QueryOrders(ctx context.Context, in *QueryOrdersRequest, opts ...grpc.CallOption) (*QueryOrdersResponse, error)
QueryTrades(ctx context.Context, in *QueryTradesRequest, opts ...grpc.CallOption) (*QueryTradesResponse, error)
}
type tradingServiceClient struct {
cc grpc.ClientConnInterface
}
func NewTradingServiceClient(cc grpc.ClientConnInterface) TradingServiceClient {
return &tradingServiceClient{cc}
}
func (c *tradingServiceClient) SubmitOrder(ctx context.Context, in *SubmitOrderRequest, opts ...grpc.CallOption) (*SubmitOrderResponse, error) {
out := new(SubmitOrderResponse)
err := c.cc.Invoke(ctx, "/bbgo.TradingService/SubmitOrder", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *tradingServiceClient) CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*CancelOrderResponse, error) {
out := new(CancelOrderResponse)
err := c.cc.Invoke(ctx, "/bbgo.TradingService/CancelOrder", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *tradingServiceClient) QueryOrder(ctx context.Context, in *QueryOrderRequest, opts ...grpc.CallOption) (*QueryOrderResponse, error) {
out := new(QueryOrderResponse)
err := c.cc.Invoke(ctx, "/bbgo.TradingService/QueryOrder", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *tradingServiceClient) QueryOrders(ctx context.Context, in *QueryOrdersRequest, opts ...grpc.CallOption) (*QueryOrdersResponse, error) {
out := new(QueryOrdersResponse)
err := c.cc.Invoke(ctx, "/bbgo.TradingService/QueryOrders", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *tradingServiceClient) QueryTrades(ctx context.Context, in *QueryTradesRequest, opts ...grpc.CallOption) (*QueryTradesResponse, error) {
out := new(QueryTradesResponse)
err := c.cc.Invoke(ctx, "/bbgo.TradingService/QueryTrades", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// TradingServiceServer is the server API for TradingService service.
// All implementations must embed UnimplementedTradingServiceServer
// for forward compatibility
type TradingServiceServer interface {
// request-response
SubmitOrder(context.Context, *SubmitOrderRequest) (*SubmitOrderResponse, error)
CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error)
QueryOrder(context.Context, *QueryOrderRequest) (*QueryOrderResponse, error)
QueryOrders(context.Context, *QueryOrdersRequest) (*QueryOrdersResponse, error)
QueryTrades(context.Context, *QueryTradesRequest) (*QueryTradesResponse, error)
mustEmbedUnimplementedTradingServiceServer()
}
// UnimplementedTradingServiceServer must be embedded to have forward compatible implementations.
type UnimplementedTradingServiceServer struct {
}
func (UnimplementedTradingServiceServer) SubmitOrder(context.Context, *SubmitOrderRequest) (*SubmitOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SubmitOrder not implemented")
}
func (UnimplementedTradingServiceServer) CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CancelOrder not implemented")
}
func (UnimplementedTradingServiceServer) QueryOrder(context.Context, *QueryOrderRequest) (*QueryOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueryOrder not implemented")
}
func (UnimplementedTradingServiceServer) QueryOrders(context.Context, *QueryOrdersRequest) (*QueryOrdersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueryOrders not implemented")
}
func (UnimplementedTradingServiceServer) QueryTrades(context.Context, *QueryTradesRequest) (*QueryTradesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueryTrades not implemented")
}
func (UnimplementedTradingServiceServer) mustEmbedUnimplementedTradingServiceServer() {}
// UnsafeTradingServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TradingServiceServer will
// result in compilation errors.
type UnsafeTradingServiceServer interface {
mustEmbedUnimplementedTradingServiceServer()
}
func RegisterTradingServiceServer(s grpc.ServiceRegistrar, srv TradingServiceServer) {
s.RegisterService(&TradingService_ServiceDesc, srv)
}
func _TradingService_SubmitOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SubmitOrderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TradingServiceServer).SubmitOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/bbgo.TradingService/SubmitOrder",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TradingServiceServer).SubmitOrder(ctx, req.(*SubmitOrderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TradingService_CancelOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CancelOrderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TradingServiceServer).CancelOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/bbgo.TradingService/CancelOrder",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TradingServiceServer).CancelOrder(ctx, req.(*CancelOrderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TradingService_QueryOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryOrderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TradingServiceServer).QueryOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/bbgo.TradingService/QueryOrder",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TradingServiceServer).QueryOrder(ctx, req.(*QueryOrderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TradingService_QueryOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryOrdersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TradingServiceServer).QueryOrders(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/bbgo.TradingService/QueryOrders",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TradingServiceServer).QueryOrders(ctx, req.(*QueryOrdersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TradingService_QueryTrades_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryTradesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TradingServiceServer).QueryTrades(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/bbgo.TradingService/QueryTrades",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TradingServiceServer).QueryTrades(ctx, req.(*QueryTradesRequest))
}
return interceptor(ctx, in, info, handler)
}
// TradingService_ServiceDesc is the grpc.ServiceDesc for TradingService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TradingService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "bbgo.TradingService",
HandlerType: (*TradingServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SubmitOrder",
Handler: _TradingService_SubmitOrder_Handler,
},
{
MethodName: "CancelOrder",
Handler: _TradingService_CancelOrder_Handler,
},
{
MethodName: "QueryOrder",
Handler: _TradingService_QueryOrder_Handler,
},
{
MethodName: "QueryOrders",
Handler: _TradingService_QueryOrders_Handler,
},
{
MethodName: "QueryTrades",
Handler: _TradingService_QueryTrades_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "pkg/pb/bbgo.proto",
}