Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterMarketdataServer(s grpc.ServiceRegistrar, srv MarketdataServer)
- func RegisterTradingServer(s grpc.ServiceRegistrar, srv TradingServer)
- type Asset
- type DownloadHistoricalDataRequest
- func (*DownloadHistoricalDataRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DownloadHistoricalDataRequest) GetEndDate() *pb.Date
- func (x *DownloadHistoricalDataRequest) GetStartDate() *pb.Date
- func (x *DownloadHistoricalDataRequest) GetSymbols() []string
- func (*DownloadHistoricalDataRequest) ProtoMessage()
- func (x *DownloadHistoricalDataRequest) ProtoReflect() protoreflect.Message
- func (x *DownloadHistoricalDataRequest) Reset()
- func (x *DownloadHistoricalDataRequest) String() string
- type DownloadHistoricalDataResponse
- func (*DownloadHistoricalDataResponse) Descriptor() ([]byte, []int)deprecated
- func (*DownloadHistoricalDataResponse) ProtoMessage()
- func (x *DownloadHistoricalDataResponse) ProtoReflect() protoreflect.Message
- func (x *DownloadHistoricalDataResponse) Reset()
- func (x *DownloadHistoricalDataResponse) String() string
- type GetAssetRequest
- type GetAssetResponse
- type GetIndexRequest
- type GetIndexResponse
- type GetOrdersRequest
- type GetOrdersResponse
- type GetPortfolioRequest
- type GetPortfolioResponse
- func (*GetPortfolioResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetPortfolioResponse) GetPortfolio() *Portfolio
- func (*GetPortfolioResponse) ProtoMessage()
- func (x *GetPortfolioResponse) ProtoReflect() protoreflect.Message
- func (x *GetPortfolioResponse) Reset()
- func (x *GetPortfolioResponse) String() string
- type MarketdataClient
- type MarketdataServer
- type MockMarketdataClient
- func (_m *MockMarketdataClient) DownloadHistoricalData(ctx context.Context, in *DownloadHistoricalDataRequest, ...) (*DownloadHistoricalDataResponse, error)
- func (_m *MockMarketdataClient) GetAsset(ctx context.Context, in *GetAssetRequest, opts ...grpc.CallOption) (*GetAssetResponse, error)
- func (_m *MockMarketdataClient) GetIndex(ctx context.Context, in *GetIndexRequest, opts ...grpc.CallOption) (*GetIndexResponse, error)
- type MockMarketdataServer
- func (_m *MockMarketdataServer) DownloadHistoricalData(_a0 context.Context, _a1 *DownloadHistoricalDataRequest) (*DownloadHistoricalDataResponse, error)
- func (_m *MockMarketdataServer) GetAsset(_a0 context.Context, _a1 *GetAssetRequest) (*GetAssetResponse, error)
- func (_m *MockMarketdataServer) GetIndex(_a0 context.Context, _a1 *GetIndexRequest) (*GetIndexResponse, error)
- type MockTradingClient
- func (_m *MockTradingClient) GetOrders(ctx context.Context, in *GetOrdersRequest, opts ...grpc.CallOption) (*GetOrdersResponse, error)
- func (_m *MockTradingClient) GetPortfolio(ctx context.Context, in *GetPortfolioRequest, opts ...grpc.CallOption) (*GetPortfolioResponse, error)
- func (_m *MockTradingClient) PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error)
- type MockTradingServer
- func (_m *MockTradingServer) GetOrders(_a0 context.Context, _a1 *GetOrdersRequest) (*GetOrdersResponse, error)
- func (_m *MockTradingServer) GetPortfolio(_a0 context.Context, _a1 *GetPortfolioRequest) (*GetPortfolioResponse, error)
- func (_m *MockTradingServer) PlaceOrder(_a0 context.Context, _a1 *PlaceOrderRequest) (*PlaceOrderResponse, error)
- type MockUnsafeMarketdataServer
- type MockUnsafeTradingServer
- type OHLC
- func (*OHLC) Descriptor() ([]byte, []int)deprecated
- func (x *OHLC) GetClose() float64
- func (x *OHLC) GetHigh() float64
- func (x *OHLC) GetLow() float64
- func (x *OHLC) GetOpen() float64
- func (x *OHLC) GetSymbol() string
- func (x *OHLC) GetTimestamp() *timestamppb.Timestamp
- func (x *OHLC) GetVolume() uint64
- func (*OHLC) ProtoMessage()
- func (x *OHLC) ProtoReflect() protoreflect.Message
- func (x *OHLC) Reset()
- func (x *OHLC) String() string
- type Order
- type PlaceOrderRequest
- type PlaceOrderResponse
- type Portfolio
- func (*Portfolio) Descriptor() ([]byte, []int)deprecated
- func (x *Portfolio) GetCash() float64
- func (x *Portfolio) GetCashFlow() float64
- func (x *Portfolio) GetPnl() float64
- func (x *Portfolio) GetPortfolioValue() float64
- func (x *Portfolio) GetPositions() []*Position
- func (x *Portfolio) GetPositionsExposure() float64
- func (x *Portfolio) GetPositionsValue() float64
- func (x *Portfolio) GetReturns() float64
- func (x *Portfolio) GetStartingCash() float64
- func (x *Portfolio) GetTimestamp() *timestamppb.Timestamp
- func (*Portfolio) ProtoMessage()
- func (x *Portfolio) ProtoReflect() protoreflect.Message
- func (x *Portfolio) Reset()
- func (x *Portfolio) String() string
- type Position
- func (*Position) Descriptor() ([]byte, []int)deprecated
- func (x *Position) GetAmount() int32
- func (x *Position) GetCostBasis() float64
- func (x *Position) GetLastSaleDate() *timestamppb.Timestamp
- func (x *Position) GetLastSalePrice() float64
- func (x *Position) GetSymbol() string
- func (*Position) ProtoMessage()
- func (x *Position) ProtoReflect() protoreflect.Message
- func (x *Position) Reset()
- func (x *Position) String() string
- type TradingClient
- type TradingServer
- type UnimplementedMarketdataServer
- func (UnimplementedMarketdataServer) DownloadHistoricalData(context.Context, *DownloadHistoricalDataRequest) (*DownloadHistoricalDataResponse, error)
- func (UnimplementedMarketdataServer) GetAsset(context.Context, *GetAssetRequest) (*GetAssetResponse, error)
- func (UnimplementedMarketdataServer) GetIndex(context.Context, *GetIndexRequest) (*GetIndexResponse, error)
- type UnimplementedTradingServer
- func (UnimplementedTradingServer) GetOrders(context.Context, *GetOrdersRequest) (*GetOrdersResponse, error)
- func (UnimplementedTradingServer) GetPortfolio(context.Context, *GetPortfolioRequest) (*GetPortfolioResponse, error)
- func (UnimplementedTradingServer) PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error)
- type UnsafeMarketdataServer
- type UnsafeTradingServer
Constants ¶
const ( Marketdata_GetAsset_FullMethodName = "/foreverbull.finance.Marketdata/GetAsset" Marketdata_GetIndex_FullMethodName = "/foreverbull.finance.Marketdata/GetIndex" Marketdata_DownloadHistoricalData_FullMethodName = "/foreverbull.finance.Marketdata/DownloadHistoricalData" )
const ( Trading_GetPortfolio_FullMethodName = "/foreverbull.finance.Trading/GetPortfolio" Trading_GetOrders_FullMethodName = "/foreverbull.finance.Trading/GetOrders" Trading_PlaceOrder_FullMethodName = "/foreverbull.finance.Trading/PlaceOrder" )
Variables ¶
var File_foreverbull_finance_finance_proto protoreflect.FileDescriptor
var File_foreverbull_finance_marketdata_service_proto protoreflect.FileDescriptor
var File_foreverbull_finance_trading_service_proto protoreflect.FileDescriptor
var Marketdata_ServiceDesc = grpc.ServiceDesc{ ServiceName: "foreverbull.finance.Marketdata", HandlerType: (*MarketdataServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetAsset", Handler: _Marketdata_GetAsset_Handler, }, { MethodName: "GetIndex", Handler: _Marketdata_GetIndex_Handler, }, { MethodName: "DownloadHistoricalData", Handler: _Marketdata_DownloadHistoricalData_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "foreverbull/finance/marketdata_service.proto", }
Marketdata_ServiceDesc is the grpc.ServiceDesc for Marketdata service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var Trading_ServiceDesc = grpc.ServiceDesc{ ServiceName: "foreverbull.finance.Trading", HandlerType: (*TradingServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetPortfolio", Handler: _Trading_GetPortfolio_Handler, }, { MethodName: "GetOrders", Handler: _Trading_GetOrders_Handler, }, { MethodName: "PlaceOrder", Handler: _Trading_PlaceOrder_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "foreverbull/finance/trading_service.proto", }
Trading_ServiceDesc is the grpc.ServiceDesc for Trading service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMarketdataServer ¶
func RegisterMarketdataServer(s grpc.ServiceRegistrar, srv MarketdataServer)
func RegisterTradingServer ¶
func RegisterTradingServer(s grpc.ServiceRegistrar, srv TradingServer)
Types ¶
type Asset ¶
type Asset struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Asset) Descriptor
deprecated
func (*Asset) ProtoMessage ¶
func (*Asset) ProtoMessage()
func (*Asset) ProtoReflect ¶
func (x *Asset) ProtoReflect() protoreflect.Message
type DownloadHistoricalDataRequest ¶
type DownloadHistoricalDataRequest struct { Symbols []string `protobuf:"bytes,1,rep,name=symbols,proto3" json:"symbols,omitempty"` StartDate *pb.Date `protobuf:"bytes,2,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` EndDate *pb.Date `protobuf:"bytes,3,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` // contains filtered or unexported fields }
func (*DownloadHistoricalDataRequest) Descriptor
deprecated
func (*DownloadHistoricalDataRequest) Descriptor() ([]byte, []int)
Deprecated: Use DownloadHistoricalDataRequest.ProtoReflect.Descriptor instead.
func (*DownloadHistoricalDataRequest) GetEndDate ¶
func (x *DownloadHistoricalDataRequest) GetEndDate() *pb.Date
func (*DownloadHistoricalDataRequest) GetStartDate ¶
func (x *DownloadHistoricalDataRequest) GetStartDate() *pb.Date
func (*DownloadHistoricalDataRequest) GetSymbols ¶
func (x *DownloadHistoricalDataRequest) GetSymbols() []string
func (*DownloadHistoricalDataRequest) ProtoMessage ¶
func (*DownloadHistoricalDataRequest) ProtoMessage()
func (*DownloadHistoricalDataRequest) ProtoReflect ¶
func (x *DownloadHistoricalDataRequest) ProtoReflect() protoreflect.Message
func (*DownloadHistoricalDataRequest) Reset ¶
func (x *DownloadHistoricalDataRequest) Reset()
func (*DownloadHistoricalDataRequest) String ¶
func (x *DownloadHistoricalDataRequest) String() string
type DownloadHistoricalDataResponse ¶
type DownloadHistoricalDataResponse struct {
// contains filtered or unexported fields
}
func (*DownloadHistoricalDataResponse) Descriptor
deprecated
func (*DownloadHistoricalDataResponse) Descriptor() ([]byte, []int)
Deprecated: Use DownloadHistoricalDataResponse.ProtoReflect.Descriptor instead.
func (*DownloadHistoricalDataResponse) ProtoMessage ¶
func (*DownloadHistoricalDataResponse) ProtoMessage()
func (*DownloadHistoricalDataResponse) ProtoReflect ¶
func (x *DownloadHistoricalDataResponse) ProtoReflect() protoreflect.Message
func (*DownloadHistoricalDataResponse) Reset ¶
func (x *DownloadHistoricalDataResponse) Reset()
func (*DownloadHistoricalDataResponse) String ¶
func (x *DownloadHistoricalDataResponse) String() string
type GetAssetRequest ¶
type GetAssetRequest struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` // contains filtered or unexported fields }
func (*GetAssetRequest) Descriptor
deprecated
func (*GetAssetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetAssetRequest.ProtoReflect.Descriptor instead.
func (*GetAssetRequest) GetSymbol ¶
func (x *GetAssetRequest) GetSymbol() string
func (*GetAssetRequest) ProtoMessage ¶
func (*GetAssetRequest) ProtoMessage()
func (*GetAssetRequest) ProtoReflect ¶
func (x *GetAssetRequest) ProtoReflect() protoreflect.Message
func (*GetAssetRequest) Reset ¶
func (x *GetAssetRequest) Reset()
func (*GetAssetRequest) String ¶
func (x *GetAssetRequest) String() string
type GetAssetResponse ¶
type GetAssetResponse struct { Asset *Asset `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` // contains filtered or unexported fields }
func (*GetAssetResponse) Descriptor
deprecated
func (*GetAssetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetAssetResponse.ProtoReflect.Descriptor instead.
func (*GetAssetResponse) GetAsset ¶
func (x *GetAssetResponse) GetAsset() *Asset
func (*GetAssetResponse) ProtoMessage ¶
func (*GetAssetResponse) ProtoMessage()
func (*GetAssetResponse) ProtoReflect ¶
func (x *GetAssetResponse) ProtoReflect() protoreflect.Message
func (*GetAssetResponse) Reset ¶
func (x *GetAssetResponse) Reset()
func (*GetAssetResponse) String ¶
func (x *GetAssetResponse) String() string
type GetIndexRequest ¶
type GetIndexRequest struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` // contains filtered or unexported fields }
func (*GetIndexRequest) Descriptor
deprecated
func (*GetIndexRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetIndexRequest.ProtoReflect.Descriptor instead.
func (*GetIndexRequest) GetSymbol ¶
func (x *GetIndexRequest) GetSymbol() string
func (*GetIndexRequest) ProtoMessage ¶
func (*GetIndexRequest) ProtoMessage()
func (*GetIndexRequest) ProtoReflect ¶
func (x *GetIndexRequest) ProtoReflect() protoreflect.Message
func (*GetIndexRequest) Reset ¶
func (x *GetIndexRequest) Reset()
func (*GetIndexRequest) String ¶
func (x *GetIndexRequest) String() string
type GetIndexResponse ¶
type GetIndexResponse struct { Assets []*Asset `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` // contains filtered or unexported fields }
func (*GetIndexResponse) Descriptor
deprecated
func (*GetIndexResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetIndexResponse.ProtoReflect.Descriptor instead.
func (*GetIndexResponse) GetAssets ¶
func (x *GetIndexResponse) GetAssets() []*Asset
func (*GetIndexResponse) ProtoMessage ¶
func (*GetIndexResponse) ProtoMessage()
func (*GetIndexResponse) ProtoReflect ¶
func (x *GetIndexResponse) ProtoReflect() protoreflect.Message
func (*GetIndexResponse) Reset ¶
func (x *GetIndexResponse) Reset()
func (*GetIndexResponse) String ¶
func (x *GetIndexResponse) String() string
type GetOrdersRequest ¶
type GetOrdersRequest struct {
// contains filtered or unexported fields
}
func (*GetOrdersRequest) Descriptor
deprecated
func (*GetOrdersRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetOrdersRequest.ProtoReflect.Descriptor instead.
func (*GetOrdersRequest) ProtoMessage ¶
func (*GetOrdersRequest) ProtoMessage()
func (*GetOrdersRequest) ProtoReflect ¶
func (x *GetOrdersRequest) ProtoReflect() protoreflect.Message
func (*GetOrdersRequest) Reset ¶
func (x *GetOrdersRequest) Reset()
func (*GetOrdersRequest) String ¶
func (x *GetOrdersRequest) String() string
type GetOrdersResponse ¶
type GetOrdersResponse struct { Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"` // contains filtered or unexported fields }
func (*GetOrdersResponse) Descriptor
deprecated
func (*GetOrdersResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetOrdersResponse.ProtoReflect.Descriptor instead.
func (*GetOrdersResponse) GetOrders ¶
func (x *GetOrdersResponse) GetOrders() []*Order
func (*GetOrdersResponse) ProtoMessage ¶
func (*GetOrdersResponse) ProtoMessage()
func (*GetOrdersResponse) ProtoReflect ¶
func (x *GetOrdersResponse) ProtoReflect() protoreflect.Message
func (*GetOrdersResponse) Reset ¶
func (x *GetOrdersResponse) Reset()
func (*GetOrdersResponse) String ¶
func (x *GetOrdersResponse) String() string
type GetPortfolioRequest ¶
type GetPortfolioRequest struct {
// contains filtered or unexported fields
}
func (*GetPortfolioRequest) Descriptor
deprecated
func (*GetPortfolioRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPortfolioRequest.ProtoReflect.Descriptor instead.
func (*GetPortfolioRequest) ProtoMessage ¶
func (*GetPortfolioRequest) ProtoMessage()
func (*GetPortfolioRequest) ProtoReflect ¶
func (x *GetPortfolioRequest) ProtoReflect() protoreflect.Message
func (*GetPortfolioRequest) Reset ¶
func (x *GetPortfolioRequest) Reset()
func (*GetPortfolioRequest) String ¶
func (x *GetPortfolioRequest) String() string
type GetPortfolioResponse ¶
type GetPortfolioResponse struct { Portfolio *Portfolio `protobuf:"bytes,1,opt,name=portfolio,proto3" json:"portfolio,omitempty"` // contains filtered or unexported fields }
func (*GetPortfolioResponse) Descriptor
deprecated
func (*GetPortfolioResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPortfolioResponse.ProtoReflect.Descriptor instead.
func (*GetPortfolioResponse) GetPortfolio ¶
func (x *GetPortfolioResponse) GetPortfolio() *Portfolio
func (*GetPortfolioResponse) ProtoMessage ¶
func (*GetPortfolioResponse) ProtoMessage()
func (*GetPortfolioResponse) ProtoReflect ¶
func (x *GetPortfolioResponse) ProtoReflect() protoreflect.Message
func (*GetPortfolioResponse) Reset ¶
func (x *GetPortfolioResponse) Reset()
func (*GetPortfolioResponse) String ¶
func (x *GetPortfolioResponse) String() string
type MarketdataClient ¶
type MarketdataClient interface { GetAsset(ctx context.Context, in *GetAssetRequest, opts ...grpc.CallOption) (*GetAssetResponse, error) GetIndex(ctx context.Context, in *GetIndexRequest, opts ...grpc.CallOption) (*GetIndexResponse, error) DownloadHistoricalData(ctx context.Context, in *DownloadHistoricalDataRequest, opts ...grpc.CallOption) (*DownloadHistoricalDataResponse, error) }
MarketdataClient is the client API for Marketdata 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.
func NewMarketdataClient ¶
func NewMarketdataClient(cc grpc.ClientConnInterface) MarketdataClient
type MarketdataServer ¶
type MarketdataServer interface { GetAsset(context.Context, *GetAssetRequest) (*GetAssetResponse, error) GetIndex(context.Context, *GetIndexRequest) (*GetIndexResponse, error) DownloadHistoricalData(context.Context, *DownloadHistoricalDataRequest) (*DownloadHistoricalDataResponse, error) // contains filtered or unexported methods }
MarketdataServer is the server API for Marketdata service. All implementations must embed UnimplementedMarketdataServer for forward compatibility.
type MockMarketdataClient ¶
MockMarketdataClient is an autogenerated mock type for the MarketdataClient type
func NewMockMarketdataClient ¶
func NewMockMarketdataClient(t interface { mock.TestingT Cleanup(func()) }) *MockMarketdataClient
NewMockMarketdataClient creates a new instance of MockMarketdataClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockMarketdataClient) DownloadHistoricalData ¶
func (_m *MockMarketdataClient) DownloadHistoricalData(ctx context.Context, in *DownloadHistoricalDataRequest, opts ...grpc.CallOption) (*DownloadHistoricalDataResponse, error)
DownloadHistoricalData provides a mock function with given fields: ctx, in, opts
func (*MockMarketdataClient) GetAsset ¶
func (_m *MockMarketdataClient) GetAsset(ctx context.Context, in *GetAssetRequest, opts ...grpc.CallOption) (*GetAssetResponse, error)
GetAsset provides a mock function with given fields: ctx, in, opts
func (*MockMarketdataClient) GetIndex ¶
func (_m *MockMarketdataClient) GetIndex(ctx context.Context, in *GetIndexRequest, opts ...grpc.CallOption) (*GetIndexResponse, error)
GetIndex provides a mock function with given fields: ctx, in, opts
type MockMarketdataServer ¶
MockMarketdataServer is an autogenerated mock type for the MarketdataServer type
func NewMockMarketdataServer ¶
func NewMockMarketdataServer(t interface { mock.TestingT Cleanup(func()) }) *MockMarketdataServer
NewMockMarketdataServer creates a new instance of MockMarketdataServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockMarketdataServer) DownloadHistoricalData ¶
func (_m *MockMarketdataServer) DownloadHistoricalData(_a0 context.Context, _a1 *DownloadHistoricalDataRequest) (*DownloadHistoricalDataResponse, error)
DownloadHistoricalData provides a mock function with given fields: _a0, _a1
func (*MockMarketdataServer) GetAsset ¶
func (_m *MockMarketdataServer) GetAsset(_a0 context.Context, _a1 *GetAssetRequest) (*GetAssetResponse, error)
GetAsset provides a mock function with given fields: _a0, _a1
func (*MockMarketdataServer) GetIndex ¶
func (_m *MockMarketdataServer) GetIndex(_a0 context.Context, _a1 *GetIndexRequest) (*GetIndexResponse, error)
GetIndex provides a mock function with given fields: _a0, _a1
type MockTradingClient ¶
MockTradingClient is an autogenerated mock type for the TradingClient type
func NewMockTradingClient ¶
func NewMockTradingClient(t interface { mock.TestingT Cleanup(func()) }) *MockTradingClient
NewMockTradingClient creates a new instance of MockTradingClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockTradingClient) GetOrders ¶
func (_m *MockTradingClient) GetOrders(ctx context.Context, in *GetOrdersRequest, opts ...grpc.CallOption) (*GetOrdersResponse, error)
GetOrders provides a mock function with given fields: ctx, in, opts
func (*MockTradingClient) GetPortfolio ¶
func (_m *MockTradingClient) GetPortfolio(ctx context.Context, in *GetPortfolioRequest, opts ...grpc.CallOption) (*GetPortfolioResponse, error)
GetPortfolio provides a mock function with given fields: ctx, in, opts
func (*MockTradingClient) PlaceOrder ¶
func (_m *MockTradingClient) PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error)
PlaceOrder provides a mock function with given fields: ctx, in, opts
type MockTradingServer ¶
MockTradingServer is an autogenerated mock type for the TradingServer type
func NewMockTradingServer ¶
func NewMockTradingServer(t interface { mock.TestingT Cleanup(func()) }) *MockTradingServer
NewMockTradingServer creates a new instance of MockTradingServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockTradingServer) GetOrders ¶
func (_m *MockTradingServer) GetOrders(_a0 context.Context, _a1 *GetOrdersRequest) (*GetOrdersResponse, error)
GetOrders provides a mock function with given fields: _a0, _a1
func (*MockTradingServer) GetPortfolio ¶
func (_m *MockTradingServer) GetPortfolio(_a0 context.Context, _a1 *GetPortfolioRequest) (*GetPortfolioResponse, error)
GetPortfolio provides a mock function with given fields: _a0, _a1
func (*MockTradingServer) PlaceOrder ¶
func (_m *MockTradingServer) PlaceOrder(_a0 context.Context, _a1 *PlaceOrderRequest) (*PlaceOrderResponse, error)
PlaceOrder provides a mock function with given fields: _a0, _a1
type MockUnsafeMarketdataServer ¶
MockUnsafeMarketdataServer is an autogenerated mock type for the UnsafeMarketdataServer type
func NewMockUnsafeMarketdataServer ¶
func NewMockUnsafeMarketdataServer(t interface { mock.TestingT Cleanup(func()) }) *MockUnsafeMarketdataServer
NewMockUnsafeMarketdataServer creates a new instance of MockUnsafeMarketdataServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
type MockUnsafeTradingServer ¶
MockUnsafeTradingServer is an autogenerated mock type for the UnsafeTradingServer type
func NewMockUnsafeTradingServer ¶
func NewMockUnsafeTradingServer(t interface { mock.TestingT Cleanup(func()) }) *MockUnsafeTradingServer
NewMockUnsafeTradingServer creates a new instance of MockUnsafeTradingServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
type OHLC ¶
type OHLC struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Open float64 `protobuf:"fixed64,3,opt,name=open,proto3" json:"open,omitempty"` High float64 `protobuf:"fixed64,4,opt,name=high,proto3" json:"high,omitempty"` Low float64 `protobuf:"fixed64,5,opt,name=low,proto3" json:"low,omitempty"` Close float64 `protobuf:"fixed64,6,opt,name=close,proto3" json:"close,omitempty"` Volume uint64 `protobuf:"varint,7,opt,name=volume,proto3" json:"volume,omitempty"` // contains filtered or unexported fields }
func (*OHLC) Descriptor
deprecated
func (*OHLC) GetTimestamp ¶
func (x *OHLC) GetTimestamp() *timestamppb.Timestamp
func (*OHLC) ProtoMessage ¶
func (*OHLC) ProtoMessage()
func (*OHLC) ProtoReflect ¶
func (x *OHLC) ProtoReflect() protoreflect.Message
type Order ¶
type Order struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` Amount int32 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` // contains filtered or unexported fields }
func (*Order) Descriptor
deprecated
func (*Order) ProtoMessage ¶
func (*Order) ProtoMessage()
func (*Order) ProtoReflect ¶
func (x *Order) ProtoReflect() protoreflect.Message
type PlaceOrderRequest ¶
type PlaceOrderRequest struct { Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` // contains filtered or unexported fields }
func (*PlaceOrderRequest) Descriptor
deprecated
func (*PlaceOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use PlaceOrderRequest.ProtoReflect.Descriptor instead.
func (*PlaceOrderRequest) GetOrder ¶
func (x *PlaceOrderRequest) GetOrder() *Order
func (*PlaceOrderRequest) ProtoMessage ¶
func (*PlaceOrderRequest) ProtoMessage()
func (*PlaceOrderRequest) ProtoReflect ¶
func (x *PlaceOrderRequest) ProtoReflect() protoreflect.Message
func (*PlaceOrderRequest) Reset ¶
func (x *PlaceOrderRequest) Reset()
func (*PlaceOrderRequest) String ¶
func (x *PlaceOrderRequest) String() string
type PlaceOrderResponse ¶
type PlaceOrderResponse struct {
// contains filtered or unexported fields
}
func (*PlaceOrderResponse) Descriptor
deprecated
func (*PlaceOrderResponse) Descriptor() ([]byte, []int)
Deprecated: Use PlaceOrderResponse.ProtoReflect.Descriptor instead.
func (*PlaceOrderResponse) ProtoMessage ¶
func (*PlaceOrderResponse) ProtoMessage()
func (*PlaceOrderResponse) ProtoReflect ¶
func (x *PlaceOrderResponse) ProtoReflect() protoreflect.Message
func (*PlaceOrderResponse) Reset ¶
func (x *PlaceOrderResponse) Reset()
func (*PlaceOrderResponse) String ¶
func (x *PlaceOrderResponse) String() string
type Portfolio ¶
type Portfolio struct { Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` CashFlow float64 `protobuf:"fixed64,2,opt,name=cash_flow,json=cashFlow,proto3" json:"cash_flow,omitempty"` StartingCash float64 `protobuf:"fixed64,3,opt,name=starting_cash,json=startingCash,proto3" json:"starting_cash,omitempty"` PortfolioValue float64 `protobuf:"fixed64,4,opt,name=portfolio_value,json=portfolioValue,proto3" json:"portfolio_value,omitempty"` Pnl float64 `protobuf:"fixed64,5,opt,name=pnl,proto3" json:"pnl,omitempty"` Returns float64 `protobuf:"fixed64,6,opt,name=returns,proto3" json:"returns,omitempty"` Cash float64 `protobuf:"fixed64,7,opt,name=cash,proto3" json:"cash,omitempty"` PositionsValue float64 `protobuf:"fixed64,8,opt,name=positions_value,json=positionsValue,proto3" json:"positions_value,omitempty"` PositionsExposure float64 `protobuf:"fixed64,9,opt,name=positions_exposure,json=positionsExposure,proto3" json:"positions_exposure,omitempty"` Positions []*Position `protobuf:"bytes,10,rep,name=positions,proto3" json:"positions,omitempty"` // contains filtered or unexported fields }
func (*Portfolio) Descriptor
deprecated
func (*Portfolio) GetCashFlow ¶
func (*Portfolio) GetPortfolioValue ¶
func (*Portfolio) GetPositions ¶
func (*Portfolio) GetPositionsExposure ¶
func (*Portfolio) GetPositionsValue ¶
func (*Portfolio) GetReturns ¶
func (*Portfolio) GetStartingCash ¶
func (*Portfolio) GetTimestamp ¶
func (x *Portfolio) GetTimestamp() *timestamppb.Timestamp
func (*Portfolio) ProtoMessage ¶
func (*Portfolio) ProtoMessage()
func (*Portfolio) ProtoReflect ¶
func (x *Portfolio) ProtoReflect() protoreflect.Message
type Position ¶
type Position struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` Amount int32 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` CostBasis float64 `protobuf:"fixed64,3,opt,name=cost_basis,json=costBasis,proto3" json:"cost_basis,omitempty"` LastSalePrice float64 `protobuf:"fixed64,4,opt,name=last_sale_price,json=lastSalePrice,proto3" json:"last_sale_price,omitempty"` LastSaleDate *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_sale_date,json=lastSaleDate,proto3" json:"last_sale_date,omitempty"` // contains filtered or unexported fields }
func (*Position) Descriptor
deprecated
func (*Position) GetCostBasis ¶
func (*Position) GetLastSaleDate ¶
func (x *Position) GetLastSaleDate() *timestamppb.Timestamp
func (*Position) GetLastSalePrice ¶
func (*Position) ProtoMessage ¶
func (*Position) ProtoMessage()
func (*Position) ProtoReflect ¶
func (x *Position) ProtoReflect() protoreflect.Message
type TradingClient ¶
type TradingClient interface { GetPortfolio(ctx context.Context, in *GetPortfolioRequest, opts ...grpc.CallOption) (*GetPortfolioResponse, error) GetOrders(ctx context.Context, in *GetOrdersRequest, opts ...grpc.CallOption) (*GetOrdersResponse, error) PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error) }
TradingClient is the client API for Trading 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.
func NewTradingClient ¶
func NewTradingClient(cc grpc.ClientConnInterface) TradingClient
type TradingServer ¶
type TradingServer interface { GetPortfolio(context.Context, *GetPortfolioRequest) (*GetPortfolioResponse, error) GetOrders(context.Context, *GetOrdersRequest) (*GetOrdersResponse, error) PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error) // contains filtered or unexported methods }
TradingServer is the server API for Trading service. All implementations must embed UnimplementedTradingServer for forward compatibility.
type UnimplementedMarketdataServer ¶
type UnimplementedMarketdataServer struct{}
UnimplementedMarketdataServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedMarketdataServer) DownloadHistoricalData ¶
func (UnimplementedMarketdataServer) DownloadHistoricalData(context.Context, *DownloadHistoricalDataRequest) (*DownloadHistoricalDataResponse, error)
func (UnimplementedMarketdataServer) GetAsset ¶
func (UnimplementedMarketdataServer) GetAsset(context.Context, *GetAssetRequest) (*GetAssetResponse, error)
func (UnimplementedMarketdataServer) GetIndex ¶
func (UnimplementedMarketdataServer) GetIndex(context.Context, *GetIndexRequest) (*GetIndexResponse, error)
type UnimplementedTradingServer ¶
type UnimplementedTradingServer struct{}
UnimplementedTradingServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedTradingServer) GetOrders ¶
func (UnimplementedTradingServer) GetOrders(context.Context, *GetOrdersRequest) (*GetOrdersResponse, error)
func (UnimplementedTradingServer) GetPortfolio ¶
func (UnimplementedTradingServer) GetPortfolio(context.Context, *GetPortfolioRequest) (*GetPortfolioResponse, error)
func (UnimplementedTradingServer) PlaceOrder ¶
func (UnimplementedTradingServer) PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error)
type UnsafeMarketdataServer ¶
type UnsafeMarketdataServer interface {
// contains filtered or unexported methods
}
UnsafeMarketdataServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MarketdataServer will result in compilation errors.
type UnsafeTradingServer ¶
type UnsafeTradingServer interface {
// contains filtered or unexported methods
}
UnsafeTradingServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TradingServer will result in compilation errors.