Documentation
¶
Index ¶
- type DBStore
- func (dr *DBStore) Close() (err error)
- func (dr *DBStore) GetKlineTables() (tbls []TableInfo, err error)
- func (dr *DBStore) GetKlineTbl(exchange, symbol, binSize string) *KlineTbl
- func (dr *DBStore) GetTableSession(tbl string, data TimeData) (sess *xorm.Session)
- func (dr *DBStore) GetTables() (tbls []string, err error)
- func (dr *DBStore) NewKlineTbl(exchange, symbol, binSize string) *KlineTbl
- func (dr *DBStore) SetDebug(bDebug bool)
- func (d *DBStore) SetUseCache(useCache bool)
- func (d *DBStore) WriteKlines(exchange, symbol, binSize string, datas []interface{}) (err error)
- type DataCreator
- type KlineTbl
- type TableInfo
- type TimeData
- type TimeTbl
- func (t *TimeTbl) AddOrUpdateData(data interface{}) (err error)
- func (t *TimeTbl) CacheData(start, end time.Time, bSize string) (err error)
- func (tbl *TimeTbl) Count() (n int64, err error)
- func (t *TimeTbl) DataChan(start, end time.Time, bSize string) (klines chan []interface{}, err error)
- func (t *TimeTbl) DataRecent(recent int32, bSize string) (klines []interface{}, err error)
- func (t *TimeTbl) Exists(data interface{}) (bRet bool, err error)
- func (t *TimeTbl) GetDatas(since, end time.Time, limit int) (datas []interface{}, err error)
- func (tbl *TimeTbl) GetNewest() (t time.Time)
- func (tbl *TimeTbl) GetOldest() (t time.Time)
- func (t *TimeTbl) GetSymbol() string
- func (t *TimeTbl) GetTable() string
- func (tbl *TimeTbl) IsEmpty() (isEmpty bool)
- func (t *TimeTbl) SetCloseCh(closeCh chan bool)
- func (t *TimeTbl) SetLoadOnce(loadOnce int)
- func (t *TimeTbl) UpdateData(data interface{}) (err error)
- func (t *TimeTbl) WriteData(data interface{}) (err error)
- func (t *TimeTbl) WriteDatas(datas []interface{}) (err error)
- type TradeTbl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBStore ¶
type DBStore struct {
// contains filtered or unexported fields
}
func NewDBStore ¶
NewDBStore support sqlite,mysql,pg
func (*DBStore) GetKlineTables ¶
func (*DBStore) GetKlineTbl ¶
GetKlineTbl get kline table
func (*DBStore) GetTableSession ¶
GetTableSession get table,if not exsit, create the table
func (*DBStore) NewKlineTbl ¶ added in v0.0.5
func (*DBStore) SetUseCache ¶ added in v0.0.5
func (*DBStore) WriteKlines ¶
WriteKlines write klines
type DataCreator ¶
type DataCreator interface {
Sing() TimeData
Slice() interface{}
GetSlice(interface{}) []interface{}
}
type KlineTbl ¶
type KlineTbl struct {
BaseProcesser
TimeTbl
// contains filtered or unexported fields
}
KlineTbl kline data table
func NewKlineTbl ¶
func (*KlineTbl) SetLoadDataMode ¶
type TimeTbl ¶
type TimeTbl struct {
// contains filtered or unexported fields
}
TimeTbl tbl with time info
func NewTimeTbl ¶
func NewTimeTbl(db *DBStore, creator DataCreator, exchange, symbol, binSize, extName string) (t *TimeTbl)
NewTimeTbl create new time table
func (*TimeTbl) AddOrUpdateData ¶
func (*TimeTbl) DataRecent ¶
func (*TimeTbl) SetCloseCh ¶
func (*TimeTbl) SetLoadOnce ¶ added in v0.0.5
func (*TimeTbl) UpdateData ¶
UpdateData update datas
func (*TimeTbl) WriteDatas ¶
WriteDatas write datas in batch. To handle incomplete candle updates (duplicate start times), existing conflicting records are deleted first, then all new records are batch inserted. The whole operation is atomic within a single transaction.
Click to show internal directories.
Click to hide internal directories.