dataloader

package
v1.2.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalOrderBook

func UnmarshalOrderBook(raw *bson.Raw, ob *OrderBook)

Types

type CsvDataLoader

type CsvDataLoader struct {
	// contains filtered or unexported fields
}

func NewCsvDataLoader

func NewCsvDataLoader(filename string) *CsvDataLoader

func (*CsvDataLoader) HasMoreData

func (l *CsvDataLoader) HasMoreData() bool

func (*CsvDataLoader) ReadOrderBooks

func (l *CsvDataLoader) ReadOrderBooks() (result []*OrderBook)

func (*CsvDataLoader) ReadRecords

func (l *CsvDataLoader) ReadRecords(limit int) []*Record

func (*CsvDataLoader) Setup

func (l *CsvDataLoader) Setup(start time.Time, end time.Time) error

type Data

type Data struct {
	// contains filtered or unexported fields
}

func NewCsvData

func NewCsvData(filename string) *Data

func NewData

func NewData(loader DataLoader) *Data

func NewMongoDBData

func NewMongoDBData(uri string, db string, exchange string, symbol string) *Data

func (*Data) GetDataRel

func (d *Data) GetDataRel() *Data

func (*Data) GetIndex

func (d *Data) GetIndex() int

func (*Data) GetMaxIndex

func (d *Data) GetMaxIndex() int

func (*Data) GetOrderBook

func (d *Data) GetOrderBook() *OrderBook

func (*Data) GetOrderBookByNS

func (d *Data) GetOrderBookByNS(symbol string, ns int64) *OrderBook

func (*Data) GetOrderBookRaw

func (d *Data) GetOrderBookRaw(offset int) *OrderBook

func (*Data) GetRecords

func (d *Data) GetRecords(size int) []*Record

func (*Data) Len

func (d *Data) Len() int

func (*Data) Next

func (d *Data) Next() bool

func (*Data) Reset

func (d *Data) Reset(start time.Time, end time.Time)

func (*Data) SetDataRel

func (d *Data) SetDataRel(relData *Data)

type DataLoader

type DataLoader interface {
	Setup(start time.Time, end time.Time) error
	ReadOrderBooks() []*OrderBook
	ReadRecords(limit int) []*Record
	HasMoreData() bool
}

type MongoDBDataLoader

type MongoDBDataLoader struct {
	// contains filtered or unexported fields
}

func NewMongoDBDataLoader

func NewMongoDBDataLoader(uri string, db string, exchange string, symbol string) *MongoDBDataLoader

func (*MongoDBDataLoader) HasMoreData

func (l *MongoDBDataLoader) HasMoreData() bool

func (*MongoDBDataLoader) ReadOrderBooks

func (l *MongoDBDataLoader) ReadOrderBooks() (result []*OrderBook)

func (*MongoDBDataLoader) ReadRecords

func (l *MongoDBDataLoader) ReadRecords(limit int) []*Record

func (*MongoDBDataLoader) Setup

func (l *MongoDBDataLoader) Setup(start time.Time, end time.Time) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL