mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-20 15:10:10 +00:00
* begins defining run management options * fleshes out concept * completes fund manager and RPC commands * coverage and improvements * adds coverage, and bad log concept * simplifies output at expense of races * removes run logging for now. tightens races. adds cov * Lints thine splints * Fixes stopping and clearing bugs * some niteroos * fix races
394 lines
16 KiB
Go
394 lines
16 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.2.0
|
|
// - protoc (unknown)
|
|
// source: btrpc.proto
|
|
|
|
package btrpc
|
|
|
|
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
|
|
|
|
// BacktesterServiceClient is the client API for BacktesterService 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 BacktesterServiceClient interface {
|
|
ExecuteStrategyFromFile(ctx context.Context, in *ExecuteStrategyFromFileRequest, opts ...grpc.CallOption) (*ExecuteStrategyResponse, error)
|
|
ExecuteStrategyFromConfig(ctx context.Context, in *ExecuteStrategyFromConfigRequest, opts ...grpc.CallOption) (*ExecuteStrategyResponse, error)
|
|
ListAllRuns(ctx context.Context, in *ListAllRunsRequest, opts ...grpc.CallOption) (*ListAllRunsResponse, error)
|
|
StartRun(ctx context.Context, in *StartRunRequest, opts ...grpc.CallOption) (*StartRunResponse, error)
|
|
StartAllRuns(ctx context.Context, in *StartAllRunsRequest, opts ...grpc.CallOption) (*StartAllRunsResponse, error)
|
|
StopRun(ctx context.Context, in *StopRunRequest, opts ...grpc.CallOption) (*StopRunResponse, error)
|
|
StopAllRuns(ctx context.Context, in *StopAllRunsRequest, opts ...grpc.CallOption) (*StopAllRunsResponse, error)
|
|
ClearRun(ctx context.Context, in *ClearRunRequest, opts ...grpc.CallOption) (*ClearRunResponse, error)
|
|
ClearAllRuns(ctx context.Context, in *ClearAllRunsRequest, opts ...grpc.CallOption) (*ClearAllRunsResponse, error)
|
|
}
|
|
|
|
type backtesterServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewBacktesterServiceClient(cc grpc.ClientConnInterface) BacktesterServiceClient {
|
|
return &backtesterServiceClient{cc}
|
|
}
|
|
|
|
func (c *backtesterServiceClient) ExecuteStrategyFromFile(ctx context.Context, in *ExecuteStrategyFromFileRequest, opts ...grpc.CallOption) (*ExecuteStrategyResponse, error) {
|
|
out := new(ExecuteStrategyResponse)
|
|
err := c.cc.Invoke(ctx, "/btrpc.BacktesterService/ExecuteStrategyFromFile", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *backtesterServiceClient) ExecuteStrategyFromConfig(ctx context.Context, in *ExecuteStrategyFromConfigRequest, opts ...grpc.CallOption) (*ExecuteStrategyResponse, error) {
|
|
out := new(ExecuteStrategyResponse)
|
|
err := c.cc.Invoke(ctx, "/btrpc.BacktesterService/ExecuteStrategyFromConfig", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *backtesterServiceClient) ListAllRuns(ctx context.Context, in *ListAllRunsRequest, opts ...grpc.CallOption) (*ListAllRunsResponse, error) {
|
|
out := new(ListAllRunsResponse)
|
|
err := c.cc.Invoke(ctx, "/btrpc.BacktesterService/ListAllRuns", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *backtesterServiceClient) StartRun(ctx context.Context, in *StartRunRequest, opts ...grpc.CallOption) (*StartRunResponse, error) {
|
|
out := new(StartRunResponse)
|
|
err := c.cc.Invoke(ctx, "/btrpc.BacktesterService/StartRun", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *backtesterServiceClient) StartAllRuns(ctx context.Context, in *StartAllRunsRequest, opts ...grpc.CallOption) (*StartAllRunsResponse, error) {
|
|
out := new(StartAllRunsResponse)
|
|
err := c.cc.Invoke(ctx, "/btrpc.BacktesterService/StartAllRuns", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *backtesterServiceClient) StopRun(ctx context.Context, in *StopRunRequest, opts ...grpc.CallOption) (*StopRunResponse, error) {
|
|
out := new(StopRunResponse)
|
|
err := c.cc.Invoke(ctx, "/btrpc.BacktesterService/StopRun", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *backtesterServiceClient) StopAllRuns(ctx context.Context, in *StopAllRunsRequest, opts ...grpc.CallOption) (*StopAllRunsResponse, error) {
|
|
out := new(StopAllRunsResponse)
|
|
err := c.cc.Invoke(ctx, "/btrpc.BacktesterService/StopAllRuns", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *backtesterServiceClient) ClearRun(ctx context.Context, in *ClearRunRequest, opts ...grpc.CallOption) (*ClearRunResponse, error) {
|
|
out := new(ClearRunResponse)
|
|
err := c.cc.Invoke(ctx, "/btrpc.BacktesterService/ClearRun", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *backtesterServiceClient) ClearAllRuns(ctx context.Context, in *ClearAllRunsRequest, opts ...grpc.CallOption) (*ClearAllRunsResponse, error) {
|
|
out := new(ClearAllRunsResponse)
|
|
err := c.cc.Invoke(ctx, "/btrpc.BacktesterService/ClearAllRuns", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// BacktesterServiceServer is the server API for BacktesterService service.
|
|
// All implementations must embed UnimplementedBacktesterServiceServer
|
|
// for forward compatibility
|
|
type BacktesterServiceServer interface {
|
|
ExecuteStrategyFromFile(context.Context, *ExecuteStrategyFromFileRequest) (*ExecuteStrategyResponse, error)
|
|
ExecuteStrategyFromConfig(context.Context, *ExecuteStrategyFromConfigRequest) (*ExecuteStrategyResponse, error)
|
|
ListAllRuns(context.Context, *ListAllRunsRequest) (*ListAllRunsResponse, error)
|
|
StartRun(context.Context, *StartRunRequest) (*StartRunResponse, error)
|
|
StartAllRuns(context.Context, *StartAllRunsRequest) (*StartAllRunsResponse, error)
|
|
StopRun(context.Context, *StopRunRequest) (*StopRunResponse, error)
|
|
StopAllRuns(context.Context, *StopAllRunsRequest) (*StopAllRunsResponse, error)
|
|
ClearRun(context.Context, *ClearRunRequest) (*ClearRunResponse, error)
|
|
ClearAllRuns(context.Context, *ClearAllRunsRequest) (*ClearAllRunsResponse, error)
|
|
mustEmbedUnimplementedBacktesterServiceServer()
|
|
}
|
|
|
|
// UnimplementedBacktesterServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedBacktesterServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedBacktesterServiceServer) ExecuteStrategyFromFile(context.Context, *ExecuteStrategyFromFileRequest) (*ExecuteStrategyResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ExecuteStrategyFromFile not implemented")
|
|
}
|
|
func (UnimplementedBacktesterServiceServer) ExecuteStrategyFromConfig(context.Context, *ExecuteStrategyFromConfigRequest) (*ExecuteStrategyResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ExecuteStrategyFromConfig not implemented")
|
|
}
|
|
func (UnimplementedBacktesterServiceServer) ListAllRuns(context.Context, *ListAllRunsRequest) (*ListAllRunsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListAllRuns not implemented")
|
|
}
|
|
func (UnimplementedBacktesterServiceServer) StartRun(context.Context, *StartRunRequest) (*StartRunResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method StartRun not implemented")
|
|
}
|
|
func (UnimplementedBacktesterServiceServer) StartAllRuns(context.Context, *StartAllRunsRequest) (*StartAllRunsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method StartAllRuns not implemented")
|
|
}
|
|
func (UnimplementedBacktesterServiceServer) StopRun(context.Context, *StopRunRequest) (*StopRunResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method StopRun not implemented")
|
|
}
|
|
func (UnimplementedBacktesterServiceServer) StopAllRuns(context.Context, *StopAllRunsRequest) (*StopAllRunsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method StopAllRuns not implemented")
|
|
}
|
|
func (UnimplementedBacktesterServiceServer) ClearRun(context.Context, *ClearRunRequest) (*ClearRunResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ClearRun not implemented")
|
|
}
|
|
func (UnimplementedBacktesterServiceServer) ClearAllRuns(context.Context, *ClearAllRunsRequest) (*ClearAllRunsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ClearAllRuns not implemented")
|
|
}
|
|
func (UnimplementedBacktesterServiceServer) mustEmbedUnimplementedBacktesterServiceServer() {}
|
|
|
|
// UnsafeBacktesterServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to BacktesterServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeBacktesterServiceServer interface {
|
|
mustEmbedUnimplementedBacktesterServiceServer()
|
|
}
|
|
|
|
func RegisterBacktesterServiceServer(s grpc.ServiceRegistrar, srv BacktesterServiceServer) {
|
|
s.RegisterService(&BacktesterService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _BacktesterService_ExecuteStrategyFromFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ExecuteStrategyFromFileRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BacktesterServiceServer).ExecuteStrategyFromFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/btrpc.BacktesterService/ExecuteStrategyFromFile",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BacktesterServiceServer).ExecuteStrategyFromFile(ctx, req.(*ExecuteStrategyFromFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _BacktesterService_ExecuteStrategyFromConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ExecuteStrategyFromConfigRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BacktesterServiceServer).ExecuteStrategyFromConfig(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/btrpc.BacktesterService/ExecuteStrategyFromConfig",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BacktesterServiceServer).ExecuteStrategyFromConfig(ctx, req.(*ExecuteStrategyFromConfigRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _BacktesterService_ListAllRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListAllRunsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BacktesterServiceServer).ListAllRuns(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/btrpc.BacktesterService/ListAllRuns",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BacktesterServiceServer).ListAllRuns(ctx, req.(*ListAllRunsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _BacktesterService_StartRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(StartRunRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BacktesterServiceServer).StartRun(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/btrpc.BacktesterService/StartRun",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BacktesterServiceServer).StartRun(ctx, req.(*StartRunRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _BacktesterService_StartAllRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(StartAllRunsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BacktesterServiceServer).StartAllRuns(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/btrpc.BacktesterService/StartAllRuns",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BacktesterServiceServer).StartAllRuns(ctx, req.(*StartAllRunsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _BacktesterService_StopRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(StopRunRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BacktesterServiceServer).StopRun(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/btrpc.BacktesterService/StopRun",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BacktesterServiceServer).StopRun(ctx, req.(*StopRunRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _BacktesterService_StopAllRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(StopAllRunsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BacktesterServiceServer).StopAllRuns(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/btrpc.BacktesterService/StopAllRuns",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BacktesterServiceServer).StopAllRuns(ctx, req.(*StopAllRunsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _BacktesterService_ClearRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ClearRunRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BacktesterServiceServer).ClearRun(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/btrpc.BacktesterService/ClearRun",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BacktesterServiceServer).ClearRun(ctx, req.(*ClearRunRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _BacktesterService_ClearAllRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ClearAllRunsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BacktesterServiceServer).ClearAllRuns(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/btrpc.BacktesterService/ClearAllRuns",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BacktesterServiceServer).ClearAllRuns(ctx, req.(*ClearAllRunsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// BacktesterService_ServiceDesc is the grpc.ServiceDesc for BacktesterService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var BacktesterService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "btrpc.BacktesterService",
|
|
HandlerType: (*BacktesterServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "ExecuteStrategyFromFile",
|
|
Handler: _BacktesterService_ExecuteStrategyFromFile_Handler,
|
|
},
|
|
{
|
|
MethodName: "ExecuteStrategyFromConfig",
|
|
Handler: _BacktesterService_ExecuteStrategyFromConfig_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListAllRuns",
|
|
Handler: _BacktesterService_ListAllRuns_Handler,
|
|
},
|
|
{
|
|
MethodName: "StartRun",
|
|
Handler: _BacktesterService_StartRun_Handler,
|
|
},
|
|
{
|
|
MethodName: "StartAllRuns",
|
|
Handler: _BacktesterService_StartAllRuns_Handler,
|
|
},
|
|
{
|
|
MethodName: "StopRun",
|
|
Handler: _BacktesterService_StopRun_Handler,
|
|
},
|
|
{
|
|
MethodName: "StopAllRuns",
|
|
Handler: _BacktesterService_StopAllRuns_Handler,
|
|
},
|
|
{
|
|
MethodName: "ClearRun",
|
|
Handler: _BacktesterService_ClearRun_Handler,
|
|
},
|
|
{
|
|
MethodName: "ClearAllRuns",
|
|
Handler: _BacktesterService_ClearAllRuns_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "btrpc.proto",
|
|
}
|