Documentation ¶
Index ¶
- Constants
- Variables
- func AlignedSize(unalignedSize int) (alignedSize int)
- func CastToByteSlice(sliceData interface{}) []byte
- func DSVToBytes(dss []DataShape) ([]byte, error)
- func DataToByteSlice(srcData interface{}) []byte
- func DownSizeSlice(iSlice interface{}, newLen int, direction DirectionEnum) (iOut interface{}, err error)
- func EpochToIndex(epoch int64, tf time.Duration) int64
- func EpochToOffset(epoch int64, tf time.Duration, recordSize int32) int64
- func FileSize(tf time.Duration, year, recordSize int) int64
- func GenericComparison(left, right interface{}, op ComparisonOperatorEnum) (result bool, err error)
- func GetCallerFileContext(level int) (fileContext string)
- func GetIntervalTicks32Bit(ts time.Time, index, intervalsPerDay int64) uint32
- func GetNamesFromDSV(dataShapes []DataShape) (out []string)
- func GetStringSliceFromInterface(iSS interface{}) (out []string)
- func GetValueAsFloat64(iValue interface{}) (val float64, err error)
- func GetValueAsInt64(iValue interface{}) (val int64, err error)
- func IndexToOffset(index int64, recordSize int32) int64
- func IndexToTime(index int64, tf time.Duration, year int16) time.Time
- func IndexToTimeDepr(index, intervalsPerDay int64, year int16) time.Time
- func Serialize(buffer []byte, datum interface{}) ([]byte, error)
- func SerializeColumnsToRows(cs *ColumnSeries, dataShapes []DataShape, align64 bool) (data []byte, recordLen int, err error)
- func SwapSliceByte(srcByteSlice, targetType interface{}) (interface{}, error)
- func SwapSliceData(srcSlice, targetType interface{}) interface{}
- func Syncfs()
- func TimeToIndex(t time.Time, tf time.Duration) int64
- func TimeToOffset(t time.Time, tf time.Duration, recordSize int32) int64
- func ToFloat32(b []byte) float32
- func ToFloat64(b []byte) float64
- func ToInt16(b []byte) int16
- func ToInt32(b []byte) int32
- func ToInt64(b []byte) int64
- func ToInt8(b []byte) int8
- func ToRune(b []byte) rune
- func ToString(b []byte) string
- func ToSystemTimezone(t time.Time) time.Time
- func ToTypeStr(elemType EnumElementType) (typeStr string, ok bool)
- func ToUInt16(b []byte) uint16
- func ToUInt32(b []byte) uint32
- func ToUInt64(b []byte) uint64
- func ToUint8(b []byte) uint8
- func WriteHeader(file *os.File, f *TimeBucketInfo) error
- type AnySet
- type ColumnInterface
- type ColumnSeries
- func (cs *ColumnSeries) AddColumn(name string, columnData interface{}) (outname string)
- func (cs *ColumnSeries) AddNullColumn(ds DataShape)
- func (cs *ColumnSeries) ApplyTimeQual(tq func(epoch int64) bool) *ColumnSeries
- func (cs *ColumnSeries) CoerceColumnType(columnName string, elementType EnumElementType) (err error)
- func (cs *ColumnSeries) Exists(targetName string) bool
- func (cs *ColumnSeries) GetColumn(name string) interface{}
- func (cs *ColumnSeries) GetColumnNames() (columnNames []string)
- func (cs *ColumnSeries) GetColumns() map[string]interface{}
- func (cs *ColumnSeries) GetDataShapes() (ds []DataShape)
- func (cs *ColumnSeries) GetEpoch() []int64
- func (cs *ColumnSeries) GetNumColumns() (length int)
- func (cs *ColumnSeries) GetTime() ([]time.Time, error)
- func (cs *ColumnSeries) IsEmpty() bool
- func (cs *ColumnSeries) Len() int
- func (cs *ColumnSeries) Project(keepList []string) error
- func (cs *ColumnSeries) Remove(targetName string) error
- func (cs *ColumnSeries) Rename(newName, oldName string) error
- func (cs *ColumnSeries) Replace(targetName string, col interface{}) error
- func (cs *ColumnSeries) RestrictLength(newLen int, direction DirectionEnum) (err error)
- func (cs *ColumnSeries) RestrictViaBitmap(bitmap []bool) (err error)
- func (cs *ColumnSeries) ToRowSeries(itemKey TimeBucketKey, alignData bool) (rs *RowSeries, err error)
- type ColumnSeriesMap
- func (csm ColumnSeriesMap) AddColumn(key TimeBucketKey, name string, columnData interface{})
- func (csm ColumnSeriesMap) AddColumnSeries(key TimeBucketKey, cs *ColumnSeries)
- func (csm *ColumnSeriesMap) FilterColumns(columns []string)
- func (csm ColumnSeriesMap) GetMetadataKeys() (keys []TimeBucketKey)
- func (csm ColumnSeriesMap) IsEmpty() bool
- type ComparisonOperatorEnum
- type DataShape
- func DSVFromBytes(buf []byte) (dataShape []DataShape, byteLength int)
- func DataShapesFromInputString(inputStr string) (dsa []DataShape, err error)
- func ExtractDatashapesByNames(dsv []DataShape, names []string) (out []DataShape)
- func GetDSVFromInterface(iDSV interface{}) (out []DataShape)
- func GetMissingAndTypeCoercionColumns(requiredDSV, availableDSV []DataShape) (missing, coercion []DataShape, err error)
- func NewDataShapeVector(names []string, etypes []EnumElementType) (dsv []DataShape)
- type DirectionEnum
- type EnumElementType
- func (e EnumElementType) ConvertByteSliceInto(data []byte) (interface{}, error)
- func (e EnumElementType) Kind() reflect.Kind
- func (e EnumElementType) Size() int
- func (e EnumElementType) SliceInBytesAt(bs []byte, index int) []byte
- func (e EnumElementType) SliceOf(length int) (sliceOf interface{})
- func (i EnumElementType) String() string
- func (e EnumElementType) TypeOf() reflect.Type
- type EnumRecordType
- type Header
- type MValue
- type NumpyDataset
- type NumpyMultiDataset
- type RowSeries
- func (rs *RowSeries) GetColumn(colname string) (col interface{})
- func (rs *RowSeries) GetData() []byte
- func (rs *RowSeries) GetDataShapes() (ds []DataShape)
- func (rs *RowSeries) GetEpoch() (col []int64)
- func (rs *RowSeries) GetMetadataKey() TimeBucketKey
- func (rs *RowSeries) GetNumRows() int
- func (rs *RowSeries) GetRow(i int) []byte
- func (rs *RowSeries) GetRowLen() int
- func (rs *RowSeries) GetTime() ([]time.Time, error)
- func (rs *RowSeries) Len() int
- func (rs *RowSeries) SetRowLen(rowLen int)
- func (rs *RowSeries) ToColumnSeries() (key TimeBucketKey, cs *ColumnSeries)
- type RowSeriesInterface
- type Rows
- func (rows *Rows) GetColumn(colname string) (col interface{})
- func (rows *Rows) GetData() []byte
- func (rows *Rows) GetDataShapes() []DataShape
- func (rows *Rows) GetNumRows() int
- func (rows *Rows) GetRow(i int) []byte
- func (rows *Rows) GetRowLen() (rowLength int)
- func (rows *Rows) GetTime() ([]time.Time, error)
- func (rows *Rows) Len() int
- func (rows *Rows) SetRowLen(rowLen int)
- func (rows *Rows) ToColumnSeries() (*ColumnSeries, error)
- type RowsInterface
- type TimeBucketInfo
- func (f *TimeBucketInfo) GetDataShapes() []DataShape
- func (f *TimeBucketInfo) GetDataShapesWithEpoch() (out []DataShape)
- func (f *TimeBucketInfo) GetDeepCopy() *TimeBucketInfo
- func (f *TimeBucketInfo) GetDescription() string
- func (f *TimeBucketInfo) GetElementNames() []string
- func (f *TimeBucketInfo) GetElementTypes() []EnumElementType
- func (f *TimeBucketInfo) GetIntervals() int64
- func (f *TimeBucketInfo) GetNelements() int32
- func (f *TimeBucketInfo) GetRecordLength() int32
- func (f *TimeBucketInfo) GetRecordType() EnumRecordType
- func (f *TimeBucketInfo) GetTimeframe() time.Duration
- func (f *TimeBucketInfo) GetVariableRecordLength() int32
- func (f *TimeBucketInfo) GetVersion() int64
- func (f *TimeBucketInfo) SetElementTypes(newTypes []EnumElementType) error
- type TimeBucketKey
- func (mk *TimeBucketKey) GetCatKey() (catKey string)
- func (mk *TimeBucketKey) GetCategories() (cats []string)
- func (mk *TimeBucketKey) GetItemInCategory(catName string) (item string)
- func (mk *TimeBucketKey) GetItemKey() (itemKey string)
- func (mk *TimeBucketKey) GetItems() (items []string)
- func (mk *TimeBucketKey) GetMultiItemInCategory(catName string) (items []string)
- func (mk *TimeBucketKey) GetPathToYearFiles(rootDir string) string
- func (mk *TimeBucketKey) GetTimeFrame() (tf *utils.Timeframe, err error)
- func (mk *TimeBucketKey) SetItemInCategory(catName, itemName string)
- func (mk *TimeBucketKey) String() (stringKey string)
Constants ¶
const ( Headersize = 37024 FileinfoVersion = int64(2.0) )
const DefaultTimeBucketSchema = "Symbol/Timeframe/AttributeGroup"
Variables ¶
var ErrColumnNotFound = errors.New("column does not exist")
Functions ¶
func AlignedSize ¶
func CastToByteSlice ¶
func CastToByteSlice(sliceData interface{}) []byte
CastToByteSlice casts sliceData's memory chunk to a byte slice without copy.
func DSVToBytes ¶ added in v4.0.1
DSVToBytes serializes an array of DataShape (=Data Shape Vector) into []byte.
func DataToByteSlice ¶
func DataToByteSlice(srcData interface{}) []byte
DataToByteSlice takes a primary (non slice, non pointer) type and returns a []byte of the base type data.
func DownSizeSlice ¶
func DownSizeSlice(iSlice interface{}, newLen int, direction DirectionEnum) (iOut interface{}, err error)
func GenericComparison ¶
func GenericComparison(left, right interface{}, op ComparisonOperatorEnum, ) (result bool, err error)
func GetCallerFileContext ¶
func GetIntervalTicks32Bit ¶
func GetNamesFromDSV ¶
func GetStringSliceFromInterface ¶
func GetStringSliceFromInterface(iSS interface{}) (out []string)
func GetValueAsFloat64 ¶
func GetValueAsInt64 ¶
func IndexToOffset ¶
func IndexToTime ¶
IndexToTime returns the time.Time represented by the given index in the system timezone (UTC by default).
func Serialize ¶
Serialize serializes various primitive types into a byte representation, appends it to the specified buffer and return it. Useful for output to files.
func SerializeColumnsToRows ¶
func SwapSliceByte ¶
func SwapSliceByte(srcByteSlice, targetType interface{}) (interface{}, error)
SwapSliceByte converts a byte slice of the type into a slice of the target type without copying each value in the slice.
func SwapSliceData ¶
func SwapSliceData(srcSlice, targetType interface{}) interface{}
SwapSliceData generically converts a slice of the type into a slice of the target type without copying each value in the slice.
func TimeToIndex ¶
TimeToIndex converts a given time.Time to a file index based upon the supplied timeframe (time.Duration). TimeToIndex takes into account the system timzeone, and converts the supplied timestamp to the system timezone specified in the MarketStore configuration file (or UTC by default),.
func ToSystemTimezone ¶
ToSystemTimezone converts the given time.Time to the system timezone.
func ToTypeStr ¶
func ToTypeStr(elemType EnumElementType) (typeStr string, ok bool)
func WriteHeader ¶
func WriteHeader(file *os.File, f *TimeBucketInfo) error
WriteHeader writes the header described by a given TimeBucketInfo to the supplied file pointer.
Types ¶
type AnySet ¶
type AnySet struct {
// contains filtered or unexported fields
}
type ColumnInterface ¶
type ColumnInterface interface { GetColumn(string) interface{} GetDataShapes() []DataShape Len() int GetTime() ([]time.Time, error) }
ColumnInterface is an interface for ColumnSeries. ColumnSeries stores query results using the following keys: - Key1: Metadata key for filesystem - Key2: Data column name - Interface: Data for each key Ex:
mymap["AAPL/1Min/OHLC"]["open"] = []byte{}
type ColumnSeries ¶
type ColumnSeries struct { ColumnInterface // contains filtered or unexported fields }
func ColumnSeriesUnion ¶
func ColumnSeriesUnion(left, right *ColumnSeries) *ColumnSeries
ColumnSeriesUnion takes to column series and creates a union and returns another column series. The values in the union are unique, and right values overwrite left values in when epochs are duplicated.
func NewColumnSeries ¶
func NewColumnSeries() *ColumnSeries
func SliceColumnSeriesByEpoch ¶
func SliceColumnSeriesByEpoch(cs ColumnSeries, start, end *int64) (slc ColumnSeries, err error)
SliceColumnSeriesByEpoch slices the column series by the provided epochs, returning a new column series with only records occurring between the two provided epoch times. If only one is provided, only one is used to slice and all remaining records are also returned.
func (*ColumnSeries) AddColumn ¶
func (cs *ColumnSeries) AddColumn(name string, columnData interface{}) (outname string)
func (*ColumnSeries) AddNullColumn ¶
func (cs *ColumnSeries) AddNullColumn(ds DataShape)
func (*ColumnSeries) ApplyTimeQual ¶
func (cs *ColumnSeries) ApplyTimeQual(tq func(epoch int64) bool) *ColumnSeries
ApplyTimeQual takes a function that determines whether or not a given epoch time is valid, and applies that function to the ColumnSeries, removing invalid entries.
func (*ColumnSeries) CoerceColumnType ¶
func (cs *ColumnSeries) CoerceColumnType(columnName string, elementType EnumElementType) (err error)
CoerceColumnType replaces the data type of values in a column that has the specified name to the specified elementType.
func (*ColumnSeries) Exists ¶
func (cs *ColumnSeries) Exists(targetName string) bool
func (*ColumnSeries) GetColumn ¶
func (cs *ColumnSeries) GetColumn(name string) interface{}
func (*ColumnSeries) GetColumnNames ¶
func (cs *ColumnSeries) GetColumnNames() (columnNames []string)
func (*ColumnSeries) GetColumns ¶
func (cs *ColumnSeries) GetColumns() map[string]interface{}
func (*ColumnSeries) GetDataShapes ¶
func (cs *ColumnSeries) GetDataShapes() (ds []DataShape)
func (*ColumnSeries) GetEpoch ¶
func (cs *ColumnSeries) GetEpoch() []int64
func (*ColumnSeries) GetNumColumns ¶
func (cs *ColumnSeries) GetNumColumns() (length int)
func (*ColumnSeries) IsEmpty ¶
func (cs *ColumnSeries) IsEmpty() bool
func (*ColumnSeries) Len ¶
func (cs *ColumnSeries) Len() int
func (*ColumnSeries) Project ¶
func (cs *ColumnSeries) Project(keepList []string) error
func (*ColumnSeries) Remove ¶
func (cs *ColumnSeries) Remove(targetName string) error
func (*ColumnSeries) Rename ¶
func (cs *ColumnSeries) Rename(newName, oldName string) error
func (*ColumnSeries) Replace ¶
func (cs *ColumnSeries) Replace(targetName string, col interface{}) error
func (*ColumnSeries) RestrictLength ¶
func (cs *ColumnSeries) RestrictLength(newLen int, direction DirectionEnum) (err error)
RestrictLength applies a FIRST/LAST length restriction to this series.
func (*ColumnSeries) RestrictViaBitmap ¶
func (cs *ColumnSeries) RestrictViaBitmap(bitmap []bool) (err error)
func (*ColumnSeries) ToRowSeries ¶
func (cs *ColumnSeries) ToRowSeries(itemKey TimeBucketKey, alignData bool) (rs *RowSeries, err error)
type ColumnSeriesMap ¶
type ColumnSeriesMap map[TimeBucketKey]*ColumnSeries
func NewColumnSeriesMap ¶
func NewColumnSeriesMap() ColumnSeriesMap
func (ColumnSeriesMap) AddColumn ¶
func (csm ColumnSeriesMap) AddColumn(key TimeBucketKey, name string, columnData interface{})
func (ColumnSeriesMap) AddColumnSeries ¶
func (csm ColumnSeriesMap) AddColumnSeries(key TimeBucketKey, cs *ColumnSeries)
func (*ColumnSeriesMap) FilterColumns ¶
func (csm *ColumnSeriesMap) FilterColumns(columns []string)
FilterColumns removes columns other than the specified columns from all ColumnSeries in a ColumnSeriesMap.
func (ColumnSeriesMap) GetMetadataKeys ¶
func (csm ColumnSeriesMap) GetMetadataKeys() (keys []TimeBucketKey)
func (ColumnSeriesMap) IsEmpty ¶
func (csm ColumnSeriesMap) IsEmpty() bool
type ComparisonOperatorEnum ¶
type ComparisonOperatorEnum uint8
const ( EQ ComparisonOperatorEnum NEQ LT LTE GT GTE )
func StringToComparisonOperatorEnum ¶
func StringToComparisonOperatorEnum(opstr string) (oper ComparisonOperatorEnum)
func (ComparisonOperatorEnum) String ¶
func (co ComparisonOperatorEnum) String() string
type DataShape ¶
type DataShape struct { Name string Type EnumElementType }
func DSVFromBytes ¶ added in v4.0.1
DSVFromBytes deserializes bytes into an array of datashape (=Data Shape Vector) and return it with its byte length.
func GetDSVFromInterface ¶
func GetDSVFromInterface(iDSV interface{}) (out []DataShape)
func NewDataShapeVector ¶
func NewDataShapeVector(names []string, etypes []EnumElementType) (dsv []DataShape)
NewDataShapeVector returns a new array of DataShapes for the given array of names and element types.
func (*DataShape) Equal ¶
Equal compares both the name and type of two DataShapes, only returning true if both are equal.
type DirectionEnum ¶
type DirectionEnum uint8
const ( // limit_from_start=true -> FIRST // limit_from_start=false -> LAST (default). FIRST DirectionEnum = iota LAST )
type EnumElementType ¶
type EnumElementType byte
const ( FLOAT32 EnumElementType = iota INT32 FLOAT64 INT64 EPOCH // deprecated but kept for compatibility BYTE BOOL NONE STRING INT16 UINT8 UINT16 UINT32 UINT64 STRING16 )
NOTE: The ordering of this enum must match the File Format order
We define our own types here instead of using the (excellent!) built-in Go type system for the primary reason that we are serializing data to files and so need to have a (very!) stable on-disk representation that matches the processing we do internally.
func CreateShapesForTimeBucketInfo ¶
func CreateShapesForTimeBucketInfo(dsv []DataShape) (elementTypes []EnumElementType, elementNames []string)
func EnumElementTypeFromName ¶
func EnumElementTypeFromName(name string) EnumElementType
func GetElementType ¶
func GetElementType(datum interface{}) EnumElementType
func TypeStrToElemType ¶
func TypeStrToElemType(typeStr string) (elemType EnumElementType, ok bool)
TypeStrToElemType converts a numpy type string (e.g. "i8", "f4") to an element type ok=false is returned when unknown string is specified.
func (EnumElementType) ConvertByteSliceInto ¶
func (e EnumElementType) ConvertByteSliceInto(data []byte) (interface{}, error)
func (EnumElementType) Kind ¶
func (e EnumElementType) Kind() reflect.Kind
func (EnumElementType) Size ¶
func (e EnumElementType) Size() int
func (EnumElementType) SliceInBytesAt ¶
func (e EnumElementType) SliceInBytesAt(bs []byte, index int) []byte
SliceInBytesAt returns a byte representation of the element at index position of the original type slice, but takes byte representation of the original slice. The caller can use this over ByteSliceAt() to avoid repeated internal SwapSliceData calls.
func (EnumElementType) SliceOf ¶
func (e EnumElementType) SliceOf(length int) (sliceOf interface{})
func (EnumElementType) String ¶
func (i EnumElementType) String() string
func (EnumElementType) TypeOf ¶
func (e EnumElementType) TypeOf() reflect.Type
type EnumRecordType ¶
type EnumRecordType int8
const ( FIXED EnumRecordType = iota VARIABLE NOTYPE )
func EnumRecordTypeByName ¶
func EnumRecordTypeByName(name string) EnumRecordType
func (EnumRecordType) String ¶
func (i EnumRecordType) String() string
type Header ¶
type Header struct { Version int64 Description [descriptionHeaderBytes]byte Year int64 Timeframe int64 // Duration in nanoseconds RecordType int64 NElements int64 RecordLength int64 // Above is the fixed header portion - size is 312 Bytes = (7*8 + 256) ElementNames [maxNumElements][elementNameHeaderBytes]byte ElementTypes [maxNumElements]byte // contains filtered or unexported fields }
Header is the on-disk byte representation of the file header.
func (*Header) Load ¶
func (hp *Header) Load(f *TimeBucketInfo)
Load loads the header information from a given TimeBucketInfo.
type NumpyDataset ¶
type NumpyDataset struct { // a list of type strings such as i4 and f8 ColumnTypes []string `msgpack:"types"` // a list of column names ColumnNames []string `msgpack:"names"` // two dimensional byte arrays holding the column data. // if there are multiple rows in a DataSet, // ColumnData[columnIndex] is concatenation of the byte representation of each row. // (e.g. row1 of columnA = "\x01\x02\x03\x04", row2 of columnA = "\x05\x06\x07\x08" // => ColumnData[index of columnA] = "\x01\x02\x03\x04\x05\x06\x07\x08" ColumnData [][]byte `msgpack:"data"` Length int `msgpack:"length"` // contains filtered or unexported fields }
func NewNumpyDataset ¶
func NewNumpyDataset(cs *ColumnSeries) (nds *NumpyDataset, err error)
func (*NumpyDataset) Len ¶
func (nds *NumpyDataset) Len() int
func (*NumpyDataset) ToColumnSeries ¶
func (nds *NumpyDataset) ToColumnSeries(options ...int) (cs *ColumnSeries, err error)
type NumpyMultiDataset ¶
type NumpyMultiDataset struct { NumpyDataset StartIndex map[string]int `msgpack:"startindex"` Lengths map[string]int `msgpack:"lengths"` }
func NewNumpyMultiDataset ¶
func NewNumpyMultiDataset(nds *NumpyDataset, tbk TimeBucketKey) (nmds *NumpyMultiDataset, err error)
func (*NumpyMultiDataset) Append ¶
func (nmds *NumpyMultiDataset) Append(cs *ColumnSeries, tbk TimeBucketKey) (err error)
func (*NumpyMultiDataset) ToColumnSeriesMap ¶
func (nmds *NumpyMultiDataset) ToColumnSeriesMap() (csm ColumnSeriesMap, err error)
type RowSeries ¶
type RowSeries struct { RowSeriesInterface RowsInterface ColumnInterface // contains filtered or unexported fields }
func NewRowSeries ¶
func NewRowSeries( key TimeBucketKey, data []byte, dataShape []DataShape, rowLen int, rowType EnumRecordType, ) *RowSeries
func (*RowSeries) GetDataShapes ¶
func (*RowSeries) GetMetadataKey ¶
func (rs *RowSeries) GetMetadataKey() TimeBucketKey
func (*RowSeries) GetNumRows ¶
func (*RowSeries) ToColumnSeries ¶
func (rs *RowSeries) ToColumnSeries() (key TimeBucketKey, cs *ColumnSeries)
type RowSeriesInterface ¶
type RowSeriesInterface interface {
GetMetadataKey() string // The filesystem metadata key for this data
}
type Rows ¶
type Rows struct { ColumnInterface RowsInterface // contains filtered or unexported fields }
func (*Rows) GetDataShapes ¶
func (*Rows) GetNumRows ¶
func (*Rows) ToColumnSeries ¶
func (rows *Rows) ToColumnSeries() (*ColumnSeries, error)
type RowsInterface ¶
type TimeBucketInfo ¶
type TimeBucketInfo struct { // Year, Path and IsRead are all set on catalog startup Year int16 // Path is the absolute path to the data binary file. // (e.g. "/project/marketstore/data/TEST/1Sec/Tick/2021.bin") Path string IsRead bool // contains filtered or unexported fields }
func NewTimeBucketInfo ¶
func NewTimeBucketInfo(tf utils.Timeframe, path, description string, year int16, dsv []DataShape, recordType EnumRecordType, ) (f *TimeBucketInfo)
func NewTimeBucketInfoFromHeader ¶
func NewTimeBucketInfoFromHeader(hp *Header, path string) *TimeBucketInfo
NewTimeBucketInfoFromHeader creates a TimeBucketInfo from a given Header.
func (*TimeBucketInfo) GetDataShapes ¶
func (f *TimeBucketInfo) GetDataShapes() []DataShape
func (*TimeBucketInfo) GetDataShapesWithEpoch ¶
func (f *TimeBucketInfo) GetDataShapesWithEpoch() (out []DataShape)
func (*TimeBucketInfo) GetDeepCopy ¶
func (f *TimeBucketInfo) GetDeepCopy() *TimeBucketInfo
GetDeepCopy returns a copy of this TimeBucketInfo.
func (*TimeBucketInfo) GetDescription ¶
func (f *TimeBucketInfo) GetDescription() string
GetDescription returns the description string contained in the given TimeBucketInfo.
func (*TimeBucketInfo) GetElementNames ¶
func (f *TimeBucketInfo) GetElementNames() []string
GetElementNames returns the field names contained by the file described by the given TimeBucketInfo.
func (*TimeBucketInfo) GetElementTypes ¶
func (f *TimeBucketInfo) GetElementTypes() []EnumElementType
GetElementTypes returns the field types contained by the file described by the given TimeBucketInfo.
func (*TimeBucketInfo) GetIntervals ¶
func (f *TimeBucketInfo) GetIntervals() int64
GetIntervals returns the number of records that can fit in a 24 hour day.
func (*TimeBucketInfo) GetNelements ¶
func (f *TimeBucketInfo) GetNelements() int32
GetNelements returns the number of elements (data fields) for a given TimeBucketInfo.
func (*TimeBucketInfo) GetRecordLength ¶
func (f *TimeBucketInfo) GetRecordLength() int32
GetRecordLength returns the length of a single record in the file described by the given TimeBucketInfo.
func (*TimeBucketInfo) GetRecordType ¶
func (f *TimeBucketInfo) GetRecordType() EnumRecordType
GetRecordType returns the type of the file described by the TimeBucketInfo as an EnumRecordType.
func (*TimeBucketInfo) GetTimeframe ¶
func (f *TimeBucketInfo) GetTimeframe() time.Duration
GetTimeframe returns the duration for which each record's data is valid. This means for 1Min resolution data, GetTimeframe will return time.Minute.
func (*TimeBucketInfo) GetVariableRecordLength ¶
func (f *TimeBucketInfo) GetVariableRecordLength() int32
GetVariableRecordLength returns the length of a single record for a variable length TimeBucketInfo file.
func (*TimeBucketInfo) GetVersion ¶
func (f *TimeBucketInfo) GetVersion() int64
GetVersion returns the version number for the given TimeBucketInfo.
func (*TimeBucketInfo) SetElementTypes ¶
func (f *TimeBucketInfo) SetElementTypes(newTypes []EnumElementType) error
SetElementTypes sets the field types contained by the file described by the given TimeBucketInfo.
type TimeBucketKey ¶
type TimeBucketKey struct {
// contains filtered or unexported fields
}
func NewTimeBucketKey ¶
func NewTimeBucketKey(itemKey string, categoryKeyOpt ...string) (mk *TimeBucketKey)
func NewTimeBucketKeyFromString ¶
func NewTimeBucketKeyFromString(itemCategoryString string) (mk *TimeBucketKey)
func NewTimeBucketKeyFromWalKeyPath ¶ added in v4.1.0
func NewTimeBucketKeyFromWalKeyPath(walKeyPath string) (tbk *TimeBucketKey, year int, err error)
NewTimeBucketKeyFromWalKeyPath converts a string in walKeyPath format (e.g. "/project/marketstore/data/AMZN/1Min/TICK/2017.bin") to a TimeBucketKey and year.
func (*TimeBucketKey) GetCatKey ¶
func (mk *TimeBucketKey) GetCatKey() (catKey string)
func (*TimeBucketKey) GetCategories ¶
func (mk *TimeBucketKey) GetCategories() (cats []string)
func (*TimeBucketKey) GetItemInCategory ¶
func (mk *TimeBucketKey) GetItemInCategory(catName string) (item string)
func (*TimeBucketKey) GetItemKey ¶
func (mk *TimeBucketKey) GetItemKey() (itemKey string)
func (*TimeBucketKey) GetItems ¶
func (mk *TimeBucketKey) GetItems() (items []string)
func (*TimeBucketKey) GetMultiItemInCategory ¶
func (mk *TimeBucketKey) GetMultiItemInCategory(catName string) (items []string)
func (*TimeBucketKey) GetPathToYearFiles ¶
func (mk *TimeBucketKey) GetPathToYearFiles(rootDir string) string
func (*TimeBucketKey) GetTimeFrame ¶
func (mk *TimeBucketKey) GetTimeFrame() (tf *utils.Timeframe, err error)
func (*TimeBucketKey) SetItemInCategory ¶
func (mk *TimeBucketKey) SetItemInCategory(catName, itemName string)
func (*TimeBucketKey) String ¶
func (mk *TimeBucketKey) String() (stringKey string)