Documentation ¶
Index ¶
- Variables
- func NewDataShapeVector(names []string, etypes []io.EnumElementType) (dsv []*proto.DataShape)
- func NewServer() (*RpcServer, *DataService)
- func Profile(address string)
- func ToNumpyMultiDataSet(p *proto.NumpyMultiDataset) *io.NumpyMultiDataset
- func ToProtoNumpyMultiDataSet(nmds *io.NumpyMultiDataset) *proto.NumpyMultiDataset
- func Utilities(url string)
- type CreateRequest
- type DataService
- func (s *DataService) Create(r *http.Request, reqs *MultiCreateRequest, response *MultiServerResponse) (err error)
- func (s *DataService) Destroy(r *http.Request, reqs *MultiKeyRequest, response *MultiServerResponse) (err error)
- func (s *DataService) GetInfo(r *http.Request, reqs *MultiKeyRequest, response *MultiGetInfoResponse) (err error)
- func (s *DataService) Init()
- func (s *DataService) ListSymbols(r *http.Request, req *ListSymbolsRequest, response *ListSymbolsResponse) (err error)
- func (s *DataService) Query(r *http.Request, reqs *MultiQueryRequest, response *MultiQueryResponse) (err error)
- func (s *DataService) Write(r *http.Request, reqs *MultiWriteRequest, response *MultiServerResponse) (err error)
- type GRPCService
- func (s GRPCService) Destroy(ctx context.Context, req *proto.MultiKeyRequest) (*proto.MultiServerResponse, error)
- func (s GRPCService) ListSymbols(ctx context.Context, req *proto.ListSymbolsRequest) (*proto.ListSymbolsResponse, error)
- func (s GRPCService) Query(ctx context.Context, reqs *proto.MultiQueryRequest) (*proto.MultiQueryResponse, error)
- func (s GRPCService) ServerVersion(ctx context.Context, req *proto.ServerVersionRequest) (*proto.ServerVersionResponse, error)
- func (s GRPCService) Write(ctx context.Context, reqs *proto.MultiWriteRequest) (*proto.MultiServerResponse, error)
- type GetInfoResponse
- type HeartbeatMessage
- type KeyRequest
- type ListSymbolsRequest
- type ListSymbolsResponse
- type MultiCreateRequest
- type MultiGetInfoResponse
- type MultiKeyRequest
- type MultiQueryRequest
- type MultiQueryResponse
- type MultiServerResponse
- type MultiWriteRequest
- type QueryRequest
- type QueryRequestBuilder
- func (b *QueryRequestBuilder) End() QueryRequest
- func (b *QueryRequestBuilder) EpochEnd(value int64) *QueryRequestBuilder
- func (b *QueryRequestBuilder) EpochStart(value int64) *QueryRequestBuilder
- func (b *QueryRequestBuilder) Functions(value []string) *QueryRequestBuilder
- func (b *QueryRequestBuilder) LimitFromStart(value bool) *QueryRequestBuilder
- func (b *QueryRequestBuilder) LimitRecordCount(value int) *QueryRequestBuilder
- type QueryResponse
- type RpcServer
- type ServerResponse
- type WriteRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var Queryable uint32 // treated as bool
Functions ¶
func NewDataShapeVector ¶
func NewDataShapeVector(names []string, etypes []io.EnumElementType) (dsv []*proto.DataShape)
NewDataShapeVector returns a new array of DataShapes for the given array of names and element types
func NewServer ¶
func NewServer() (*RpcServer, *DataService)
func ToNumpyMultiDataSet ¶
func ToNumpyMultiDataSet(p *proto.NumpyMultiDataset) *io.NumpyMultiDataset
func ToProtoNumpyMultiDataSet ¶
func ToProtoNumpyMultiDataSet(nmds *io.NumpyMultiDataset) *proto.NumpyMultiDataset
Types ¶
type CreateRequest ¶
type CreateRequest struct {
Key, DataShapes, RowType string
}
Create: Creates a new time bucket in the DB
type DataService ¶
type DataService struct{}
func (*DataService) Create ¶
func (s *DataService) Create(r *http.Request, reqs *MultiCreateRequest, response *MultiServerResponse) (err error)
func (*DataService) Destroy ¶
func (s *DataService) Destroy(r *http.Request, reqs *MultiKeyRequest, response *MultiServerResponse) (err error)
func (*DataService) GetInfo ¶
func (s *DataService) GetInfo(r *http.Request, reqs *MultiKeyRequest, response *MultiGetInfoResponse) (err error)
func (*DataService) Init ¶
func (s *DataService) Init()
func (*DataService) ListSymbols ¶
func (s *DataService) ListSymbols(r *http.Request, req *ListSymbolsRequest, response *ListSymbolsResponse) (err error)
func (*DataService) Query ¶
func (s *DataService) Query(r *http.Request, reqs *MultiQueryRequest, response *MultiQueryResponse) (err error)
func (*DataService) Write ¶
func (s *DataService) Write(r *http.Request, reqs *MultiWriteRequest, response *MultiServerResponse) (err error)
type GRPCService ¶
type GRPCService struct{}
GRPCService is the implementation of GRPC API for Marketstore. All grpc/protobuf-related logics and models are defined in this file.
func (GRPCService) Destroy ¶
func (s GRPCService) Destroy(ctx context.Context, req *proto.MultiKeyRequest) (*proto.MultiServerResponse, error)
func (GRPCService) ListSymbols ¶
func (s GRPCService) ListSymbols(ctx context.Context, req *proto.ListSymbolsRequest) (*proto.ListSymbolsResponse, error)
func (GRPCService) Query ¶
func (s GRPCService) Query(ctx context.Context, reqs *proto.MultiQueryRequest) (*proto.MultiQueryResponse, error)
func (GRPCService) ServerVersion ¶
func (s GRPCService) ServerVersion(ctx context.Context, req *proto.ServerVersionRequest) (*proto.ServerVersionResponse, error)
func (GRPCService) Write ¶
func (s GRPCService) Write(ctx context.Context, reqs *proto.MultiWriteRequest) (*proto.MultiServerResponse, error)
type GetInfoResponse ¶
type GetInfoResponse struct { LatestYear int TimeFrame time.Duration DSV []io.DataShape RecordType io.EnumRecordType ServerResp ServerResponse }
type HeartbeatMessage ¶
type KeyRequest ¶
type KeyRequest struct {
Key string `msgpack:"key"`
}
type ListSymbolsRequest ¶ added in v4.0.1
type ListSymbolsRequest struct { // "symbol", or "tbk" Format string `msgpack:"format,omitempty"` }
type ListSymbolsResponse ¶
type ListSymbolsResponse struct {
Results []string
}
type MultiCreateRequest ¶
type MultiCreateRequest struct {
Requests []CreateRequest
}
type MultiGetInfoResponse ¶
type MultiGetInfoResponse struct {
Responses []GetInfoResponse `msgpack:"responses"`
}
type MultiKeyRequest ¶
type MultiKeyRequest struct {
Requests []KeyRequest `msgpack:"requests"`
}
type MultiQueryRequest ¶
type MultiQueryRequest struct { /* A multi-request allows for different Timeframes and record formats for each request */ Requests []QueryRequest `msgpack:"requests"` }
type MultiQueryResponse ¶
type MultiQueryResponse struct { Responses []QueryResponse `msgpack:"responses"` Version string `msgpack:"version"` // Server Version Timezone string `msgpack:"timezone"` // Server Timezone }
func (*MultiQueryResponse) ToColumnSeriesMap ¶
func (resp *MultiQueryResponse) ToColumnSeriesMap() (*io.ColumnSeriesMap, error)
ToColumnSeriesMap converts a MultiQueryResponse to a ColumnSeriesMap, returning an error if there is any issue encountered while converting.
type MultiServerResponse ¶
type MultiServerResponse struct {
Responses []ServerResponse `msgpack:"responses"`
}
type MultiWriteRequest ¶
type MultiWriteRequest struct { /* A multi-request allows for different Timeframes and record formats for each request */ Requests []WriteRequest `msgpack:"requests"` }
type QueryRequest ¶
type QueryRequest struct { // Note: SQL is not fully supported IsSQLStatement bool `msgpack:"is_sqlstatement"` // If this is a SQL request, Only SQLStatement is relevant SQLStatement string `msgpack:"sql_statement"` // Destination is <symbol>/<timeframe>/<attributegroup> Destination string `msgpack:"destination"` // This is not usually set, defaults to Symbol/Timeframe/AttributeGroup KeyCategory string `msgpack:"key_category,omitempty"` // Lower time predicate (i.e. index >= start) in unix epoch second EpochStart *int64 `msgpack:"epoch_start,omitempty"` // Nanosecond of the lower time predicate EpochStartNanos *int64 `msgpack:"epoch_start_nanos,omitempty"` // Upper time predicate (i.e. index <= end) in unix epoch second EpochEnd *int64 `msgpack:"epoch_end,omitempty"` // Nanosecond of the upper time predicate EpochEndNanos *int64 `msgpack:"epoch_end_nanos,omitempty"` // Number of max returned rows from lower/upper bound LimitRecordCount *int `msgpack:"limit_record_count,omitempty"` // Set to true if LimitRecordCount should be from the lower LimitFromStart *bool `msgpack:"limit_from_start,omitempty"` // Array of column names to be returned Columns []string `msgpack:"columns,omitempty"` // Support for functions is experimental and subject to change Functions []string `msgpack:"functions,omitempty"` }
This is the parameter interface for DataService.Query method.
type QueryRequestBuilder ¶
type QueryRequestBuilder struct {
// contains filtered or unexported fields
}
QueryRequestBuilder is a builder for QueryRequest to set various parameters flexibly.
qr := NewQueryRequestBuilder("TSLA/1D/OHLCV").LimitRecourdCount(100).End()
func NewQueryRequestBuilder ¶
func NewQueryRequestBuilder(destination string) *QueryRequestBuilder
func (*QueryRequestBuilder) End ¶
func (b *QueryRequestBuilder) End() QueryRequest
func (*QueryRequestBuilder) EpochEnd ¶
func (b *QueryRequestBuilder) EpochEnd(value int64) *QueryRequestBuilder
func (*QueryRequestBuilder) EpochStart ¶
func (b *QueryRequestBuilder) EpochStart(value int64) *QueryRequestBuilder
func (*QueryRequestBuilder) Functions ¶
func (b *QueryRequestBuilder) Functions(value []string) *QueryRequestBuilder
func (*QueryRequestBuilder) LimitFromStart ¶
func (b *QueryRequestBuilder) LimitFromStart(value bool) *QueryRequestBuilder
func (*QueryRequestBuilder) LimitRecordCount ¶
func (b *QueryRequestBuilder) LimitRecordCount(value int) *QueryRequestBuilder
type QueryResponse ¶
type QueryResponse struct {
Result *io.NumpyMultiDataset `msgpack:"result"`
}
type ServerResponse ¶
type WriteRequest ¶
type WriteRequest struct { Data *io.NumpyMultiDataset `msgpack:"dataset"` IsVariableLength bool `msgpack:"is_variable_length"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.