Documentation
¶
Index ¶
- Constants
- Variables
- type Collector
- func NewBinanceCollector(ctx context.Context, store Store) (Collector, error)
- func NewBittrexCollector(ctx context.Context, store Store) (Collector, error)
- func NewBittrexUSDCollector(ctx context.Context, store Store) (Collector, error)
- func NewPoloniexCollector(ctx context.Context, store Store) (Collector, error)
- type ExchangeData
- type Store
- type Tick
- type TickChartData
- type TickDto
- type TickDtoCP
- type TickDtoInterval
- type TickSyncDto
Constants ¶
View Source
const ( Bittrex = "bittrex" Bittrexusd = Bittrex + "usd" Poloniex = "poloniex" Binance = "binance" IntervalShort = "short" IntervalLong = "long" IntervalHistoric = "historic" )
Variables ¶
View Source
var ( CollectorConstructors = map[string]func(context.Context, Store) (Collector, error){ Bittrex: NewBittrexCollector, Bittrexusd: NewBittrexUSDCollector, Poloniex: NewPoloniexCollector, Binance: NewBinanceCollector, } )
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface { GetShort(context.Context) error GetLong(context.Context) error GetHistoric(context.Context) error }
func NewBinanceCollector ¶
func NewBittrexCollector ¶
func NewBittrexUSDCollector ¶
type ExchangeData ¶
type Store ¶
type Store interface { ExchangeTickTableName() string ExchangeTableName() string RegisterExchange(ctx context.Context, exchange ExchangeData) (lastShort, lastLong, lastHistoric time.Time, err error) FetchExchangeForSync(ctx context.Context, lastID int, skip, take int) ([]ExchangeData, int64, error) StoreExchangeTicks(ctx context.Context, exchange string, interval int, pair string, data []Tick) (time.Time, error) LastExchangeTickEntryTime() (time time.Time) }
type Tick ¶
type Tick struct { High float64 Low float64 Open float64 Close float64 Volume float64 Time time.Time }
Tick represents an exchange data tick
type TickChartData ¶
TickDto represents an exchange data, formatted for presentation
type TickDto ¶
type TickDto struct { ExchangeID int `json:"exchange_id"` ExchangeName string `json:"exchange_name"` High float64 `json:"high"` Low float64 `json:"low"` Open float64 `json:"open"` Close float64 `json:"close"` Volume float64 `json:"volume"` Time string `json:"time"` Interval int `json:"interval"` CurrencyPair string `json:"currency_pair"` }
TickDto represents an exchange data, formatted for presentation
type TickDtoInterval ¶
type TickDtoInterval struct {
Interval int `json:"interval"`
}
type TickSyncDto ¶
type TickSyncDto struct { ExchangeID int `json:"exchange_id"` ID int `json:"id"` ExchangeName string `json:"exchange_name"` High float64 `json:"high"` Low float64 `json:"low"` Open float64 `json:"open"` Close float64 `json:"close"` Volume float64 `json:"volume"` Time time.Time `json:"time"` Interval int `json:"interval"` CurrencyPair string `json:"currency_pair"` }
TickSyncDto represents an exchange data, structured for sharing
Click to show internal directories.
Click to hide internal directories.