Documentation ¶
Index ¶
- Constants
- func AlignedSize(unalignedSize int) (alignedSize int)
- func CastToByteSlice(sliceData interface{}) []byte
- func CopyDir(source, dest string) (err error)
- func CopyFile(source, dest string) (err error)
- func CopySliceByte(ib interface{}, is interface{}) interface{}
- func CreateSliceFromSliceOfInterface(input []interface{}, typ EnumElementType) (i_output interface{}, err error)
- func DataToByteSlice(srcData interface{}) []byte
- func DownSizeSlice(i_slice interface{}, newLen int, direction DirectionEnum) (i_out 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 int, 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(i_ss interface{}) (out []string)
- func GetValueAsFloat64(i_value interface{}) (val float64, err error)
- func GetValueAsInt64(i_value interface{}) (val int64, err error)
- func IndexToOffset(index int64, recordSize int32) int64
- func IndexToTime(index int64, tf time.Duration, year int16) time.Time
- func Serialize(buffer []byte, datum interface{}) ([]byte, error)
- func SerializeColumnsToRows(cs *ColumnSeries, dataShapes []DataShape, align64 bool) (data []byte, recordLen int)
- func SwapSliceByte(src_byte_slice interface{}, target_type interface{}) interface{}
- func SwapSliceData(src_slice interface{}, target_type 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 ToSystemTimezone(t time.Time) time.Time
- func ToUInt32(b []byte) uint32
- func ToUint8(b []byte) uint8
- func WriteHeader(file *os.File, f *TimeBucketInfo) error
- type AnySet
- type CandleAttributes
- type ColumnInterface
- type ColumnSeries
- func (cs *ColumnSeries) AddColumn(name string, columnData interface{}) (outname string)
- func (cs *ColumnSeries) AddNullColumn(ds DataShape)
- func (cs *ColumnSeries) CoerceColumnType(ds DataShape) (err error)
- func (cs *ColumnSeries) Exists(targetName string) bool
- func (cs *ColumnSeries) GetByName(name string) interface{}
- func (cs *ColumnSeries) GetCandleAttributes() (cat *CandleAttributes)
- 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
- 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) SetCandleAttributes(cat *CandleAttributes)
- func (cs *ColumnSeries) ToRowSeries(itemKey TimeBucketKey) (rs *RowSeries)
- type ColumnSeriesMap
- func (csm ColumnSeriesMap) AddColumn(key TimeBucketKey, name string, columnData interface{})
- func (csm ColumnSeriesMap) AddColumnSeries(key TimeBucketKey, cs *ColumnSeries)
- func (csm ColumnSeriesMap) GetMetadataKeys() (keys []TimeBucketKey)
- func (csm ColumnSeriesMap) IsEmpty() bool
- func (csm ColumnSeriesMap) ToRowSeriesMap(dataShapesMap map[TimeBucketKey][]DataShape) (rsMap map[TimeBucketKey]*RowSeries)
- type ComparisonOperatorEnum
- type DataShape
- func ExtractDatashapesByNames(dsv []DataShape, names []string) (out []DataShape)
- func GetDSVFromInterface(i_dsv interface{}) (out []DataShape)
- func GetMissingAndTypeCoercionColumns(requiredDSV, availableDSV []DataShape) (missing, coercion []DataShape)
- func NewDataShapeVector(names []string, etypes []EnumElementType) (dsv []DataShape)
- type DirectionEnum
- type EnumElementType
- func (e EnumElementType) ByteSliceAt(sliceOf interface{}, index int) (bs []byte)
- func (e EnumElementType) ConvertByteSliceInto(data []byte) interface{}
- 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 QuorumValue
- type RowSeries
- func (rs *RowSeries) GetCandleAttributes() *CandleAttributes
- 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) GetTPrev() time.Time
- func (rs *RowSeries) GetTime() []time.Time
- func (rs *RowSeries) Len() int
- func (rs *RowSeries) SetCandleAttributes(ca *CandleAttributes)
- func (rs *RowSeries) SetRowLen(rowLen int)
- func (rs *RowSeries) ToColumnSeries() (key TimeBucketKey, cs *ColumnSeries)
- type RowSeriesInterface
- type Rows
- func (rows *Rows) GetCandleAttributes() *CandleAttributes
- 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() (len int)
- func (rows *Rows) GetTime() []time.Time
- func (rows *Rows) Len() int
- func (rows *Rows) SetCandleAttributes(ca *CandleAttributes)
- func (rows *Rows) SetRowLen(rowLen int)
- func (rows *Rows) ToColumnSeries() *ColumnSeries
- 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 string, itemName string)
- func (mk *TimeBucketKey) String() (stringKey string)
Constants ¶
const ( None CandleAttributes = 0x0 // Default - not a candle ISCANDLE = 1 << iota // Is a candle - continuum data representation (not a tick) OHLC // Has "Open, High, Low, Close" data in the candle OHLCV // Has "Open, High, Low, Close" and "Volume" data in the candle HASFLOAT32 // 32-bit version available HASFLOAT64 // 64-bit version available )
- if None, then there are no candle attributes - not a candle - if both HASFLOAT32 and HASFLOAT64 are set, the 64-bit versions of OHLC are named using a "64" after the column name - if only one of HASFLOAT32 and HASFLOAT64 are set, the OHLC have names: "open", "high", etc
const DefaultTimeBucketSchema = "Symbol/Timeframe/AttributeGroup"
const FileinfoVersion = int64(2.0)
const Headersize = 37024
Variables ¶
This section is empty.
Functions ¶
func AlignedSize ¶
func CastToByteSlice ¶
func CastToByteSlice(sliceData interface{}) []byte
Cast sliceData's memory chunk to a byte slice without copy.
func CopySliceByte ¶
func CopySliceByte(ib interface{}, is interface{}) interface{}
func CreateSliceFromSliceOfInterface ¶
func CreateSliceFromSliceOfInterface(input []interface{}, typ EnumElementType) (i_output interface{}, err error)
func DataToByteSlice ¶
func DataToByteSlice(srcData interface{}) []byte
Takes a primary (non slice, non pointer) type and returns a []byte of the base type data
func DownSizeSlice ¶
func DownSizeSlice(i_slice interface{}, newLen int, direction DirectionEnum) (i_out 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(i_ss 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 ¶
Serializes various primitive types into a byte representation, useful for output to files
func SerializeColumnsToRows ¶
func SerializeColumnsToRows(cs *ColumnSeries, dataShapes []DataShape, align64 bool) (data []byte, recordLen int)
func SwapSliceByte ¶
func SwapSliceByte(src_byte_slice interface{}, target_type interface{}) interface{}
func SwapSliceData ¶
func SwapSliceData(src_slice interface{}, target_type interface{}) interface{}
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 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 CandleAttributes ¶
type CandleAttributes uint8
func (*CandleAttributes) AddOption ¶
func (cat *CandleAttributes) AddOption(option CandleAttributes)
func (*CandleAttributes) AnySet ¶
func (cat *CandleAttributes) AnySet(checkOption ...CandleAttributes) bool
func (*CandleAttributes) DelOption ¶
func (cat *CandleAttributes) DelOption(option CandleAttributes)
func (*CandleAttributes) IsSet ¶
func (cat *CandleAttributes) IsSet(checkOption ...CandleAttributes) bool
type ColumnInterface ¶
type ColumnInterface interface { GetColumn(string) interface{} GetDataShapes() []DataShape Len() int GetTime() []time.Time }
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 NewColumnSeries ¶
func NewColumnSeries() *ColumnSeries
func (*ColumnSeries) AddColumn ¶
func (cs *ColumnSeries) AddColumn(name string, columnData interface{}) (outname string)
func (*ColumnSeries) AddNullColumn ¶
func (cs *ColumnSeries) AddNullColumn(ds DataShape)
func (*ColumnSeries) CoerceColumnType ¶
func (cs *ColumnSeries) CoerceColumnType(ds DataShape) (err error)
func (*ColumnSeries) Exists ¶
func (cs *ColumnSeries) Exists(targetName string) bool
func (*ColumnSeries) GetByName ¶
func (cs *ColumnSeries) GetByName(name string) interface{}
func (*ColumnSeries) GetCandleAttributes ¶
func (cs *ColumnSeries) GetCandleAttributes() (cat *CandleAttributes)
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) GetTime ¶
func (cs *ColumnSeries) GetTime() []time.Time
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) SetCandleAttributes ¶
func (cs *ColumnSeries) SetCandleAttributes(cat *CandleAttributes)
func (*ColumnSeries) ToRowSeries ¶
func (cs *ColumnSeries) ToRowSeries(itemKey TimeBucketKey) (rs *RowSeries)
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) GetMetadataKeys ¶
func (csm ColumnSeriesMap) GetMetadataKeys() (keys []TimeBucketKey)
func (ColumnSeriesMap) IsEmpty ¶
func (csm ColumnSeriesMap) IsEmpty() bool
func (ColumnSeriesMap) ToRowSeriesMap ¶
func (csm ColumnSeriesMap) ToRowSeriesMap(dataShapesMap map[TimeBucketKey][]DataShape) (rsMap map[TimeBucketKey]*RowSeries)
type ComparisonOperatorEnum ¶
type ComparisonOperatorEnum uint8
Utility datatypes
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 GetDSVFromInterface ¶
func GetDSVFromInterface(i_dsv 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 EnumElementType ¶
type EnumElementType byte
const ( FLOAT32 EnumElementType = iota INT32 FLOAT64 INT64 EPOCH BYTE BOOL NONE STRING INT16 UINT8 UINT16 UINT32 UINT64 )
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 (EnumElementType) ByteSliceAt ¶
func (e EnumElementType) ByteSliceAt(sliceOf interface{}, index int) (bs []byte)
ByteSliceAt returns a byte representation of the element in the original type slice at index position.
func (EnumElementType) ConvertByteSliceInto ¶
func (e EnumElementType) ConvertByteSliceInto(data []byte) interface{}
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
type Header ¶
type Header struct { Version int64 Description [256]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 [1024][32]byte ElementTypes [1024]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 dimentional byte arrays holding the column data 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 QuorumValue ¶
type QuorumValue struct {
// contains filtered or unexported fields
}
func NewQuorumValue ¶
func NewQuorumValue() *QuorumValue
func (*QuorumValue) AddValue ¶
func (qv *QuorumValue) AddValue(ival interface{}) error
func (*QuorumValue) GetTopValue ¶
func (qv *QuorumValue) GetTopValue() (val interface{}, confidence int)
type RowSeries ¶
type RowSeries struct { RowSeriesInterface RowsInterface ColumnInterface // contains filtered or unexported fields }
func NewRowSeries ¶
func NewRowSeries(key TimeBucketKey, tPrev int64, data []byte, dataShape []DataShape, rowLen int, cat *CandleAttributes, rowType EnumRecordType) *RowSeries
func (*RowSeries) GetCandleAttributes ¶
func (rs *RowSeries) GetCandleAttributes() *CandleAttributes
func (*RowSeries) GetDataShapes ¶
func (*RowSeries) GetMetadataKey ¶
func (rs *RowSeries) GetMetadataKey() TimeBucketKey
func (*RowSeries) GetNumRows ¶
func (*RowSeries) SetCandleAttributes ¶
func (rs *RowSeries) SetCandleAttributes(ca *CandleAttributes)
func (*RowSeries) ToColumnSeries ¶
func (rs *RowSeries) ToColumnSeries() (key TimeBucketKey, cs *ColumnSeries)
type RowSeriesInterface ¶
type Rows ¶
type Rows struct { ColumnInterface RowsInterface // contains filtered or unexported fields }
func (*Rows) GetCandleAttributes ¶
func (rows *Rows) GetCandleAttributes() *CandleAttributes
func (*Rows) GetDataShapes ¶
func (*Rows) GetNumRows ¶
func (*Rows) SetCandleAttributes ¶
func (rows *Rows) SetCandleAttributes(ca *CandleAttributes)
func (*Rows) ToColumnSeries ¶
func (rows *Rows) ToColumnSeries() *ColumnSeries
type RowsInterface ¶
type RowsInterface interface { SetCandleAttributes(*CandleAttributes) GetCandleAttributes() *CandleAttributes GetRow(i int) []byte // Position to the i-th record GetData() []byte // Pointer to the beginning of the data GetNumRows() int GetRowLen() int SetRowLen(int) }
type TimeBucketInfo ¶
type TimeBucketInfo struct { // Year, Path and IsRead are all set on catalog startup Year int16 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 {
Key string `msgpack:"key"` // Key is the appended form, suitable for exported usage
}
func NewTimeBucketKey ¶
func NewTimeBucketKey(itemKey string, categoryKey_opt ...string) (mk *TimeBucketKey)
func NewTimeBucketKeyFromString ¶
func NewTimeBucketKeyFromString(itemCategoryString string) (mk *TimeBucketKey)
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 string, itemName string)
func (*TimeBucketKey) String ¶
func (mk *TimeBucketKey) String() (stringKey string)