Documentation ¶
Index ¶
- Variables
- func NewDataShapeVector(dataShapes []*proto.DataShape) (dsv []io.DataShape, err error)
- func NewServer(rootDir string, catDir *catalog.Directory, aggRunner *sqlparser.AggRunner, ...) (*RPCServer, *DataService)
- func Profile(address string)
- func ToNumpyMultiDataSet(p *proto.NumpyMultiDataset) *io.NumpyMultiDataset
- func ToProtoNumpyMultiDataSet(nmds *io.NumpyMultiDataset) *proto.NumpyMultiDataset
- type CreateRequest
- type DataService
- func (s *DataService) Create(_ *http.Request, reqs *MultiCreateRequest, response *MultiServerResponse) (err error)
- func (s *DataService) Destroy(_ *http.Request, reqs *MultiKeyRequest, response *MultiServerResponse) (err error)
- func (s *DataService) GetInfo(_ *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(_ *http.Request, reqs *MultiWriteRequest, response *MultiServerResponse) (err error)
- type GRPCService
- func (s GRPCService) Create(ctx context.Context, req *proto.MultiCreateRequest) (*proto.MultiServerResponse, error)
- 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(_ 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 QueryInterface
- 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 QueryService
- type RPCServer
- type ServerResponse
- type UtilityAPIHandlers
- type WriteRequest
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var Queryable uint32 // treated as bool
Functions ¶
func NewDataShapeVector ¶
NewDataShapeVector returns a new array of io.DataShape for the given array of proto.DataShape inputs.
func NewServer ¶
func NewServer(rootDir string, catDir *catalog.Directory, aggRunner *sqlparser.AggRunner, w Writer, q QueryInterface, ) (*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 { // bucket key string. e.g. "TSLA/1Min/OHLC" Key string `msgpack:"key"` // a list of type strings such as i4 and f8 ColumnTypes []string `msgpack:"column_types"` // a list of column names ColumnNames []string `msgpack:"column_names"` IsVariableLength bool `msgpack:"is_variable_length"` }
Create: Creates a new time bucket in the DB
type DataService ¶
type DataService struct {
// contains filtered or unexported fields
}
func NewDataService ¶ added in v4.1.1
func NewDataService(rootDir string, catDir *catalog.Directory, aggRunner *sqlparser.AggRunner, w Writer, q QueryInterface, ) *DataService
func (*DataService) Create ¶
func (s *DataService) Create(_ *http.Request, reqs *MultiCreateRequest, response *MultiServerResponse) (err error)
func (*DataService) Destroy ¶
func (s *DataService) Destroy(_ *http.Request, reqs *MultiKeyRequest, response *MultiServerResponse) (err error)
func (*DataService) GetInfo ¶
func (s *DataService) GetInfo(_ *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(_ *http.Request, reqs *MultiWriteRequest, response *MultiServerResponse) (err error)
type GRPCService ¶
type GRPCService struct {
// contains filtered or unexported fields
}
GRPCService is the implementation of GRPC API for Marketstore. All grpc/protobuf-related logics and models are defined in this file.
func NewGRPCService ¶ added in v4.1.1
func NewGRPCService(rootDir string, catDir *catalog.Directory, aggRunner *sqlparser.AggRunner, w Writer, q QueryInterface, ) *GRPCService
func (GRPCService) Create ¶ added in v4.1.1
func (s GRPCService) Create(ctx context.Context, req *proto.MultiCreateRequest) (*proto.MultiServerResponse, error)
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(_ 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 `msgpack:"requests"`
}
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 QueryInterface ¶ added in v4.1.2
type QueryInterface interface { ExecuteQuery(tbk *io.TimeBucketKey, start, end time.Time, LimitRecordCount int, LimitFromStart bool, columns []string, ) (io.ColumnSeriesMap, error) }
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 QueryService ¶ added in v4.1.2
type QueryService struct {
// contains filtered or unexported fields
}
func NewQueryService ¶ added in v4.1.2
func NewQueryService(catDir *catalog.Directory) *QueryService
func (*QueryService) ExecuteQuery ¶ added in v4.1.2
func (qs *QueryService) ExecuteQuery(tbk *io.TimeBucketKey, start, end time.Time, limitRecordCount int, limitFromStart bool, columns []string, ) (io.ColumnSeriesMap, error)
type ServerResponse ¶
type UtilityAPIHandlers ¶ added in v4.1.13
type UtilityAPIHandlers struct {
// contains filtered or unexported fields
}
func NewUtilityAPIHandlers ¶ added in v4.1.1
func NewUtilityAPIHandlers(startTime time.Time) *UtilityAPIHandlers
func (*UtilityAPIHandlers) Handle ¶ added in v4.1.13
func (uah *UtilityAPIHandlers) Handle(url string) error
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.