Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coingecko ¶
type Coingecko struct {
// contains filtered or unexported fields
}
Coingecko is a structure that implements RatesDownloaderInterface
func (*Coingecko) CurrentTickers ¶ added in v0.4.0
func (cg *Coingecko) CurrentTickers() (*common.CurrencyRatesTicker, error)
func (*Coingecko) UpdateHistoricalTickers ¶ added in v0.4.0
UpdateHistoricalTickers gets historical tickers for the main crypto currency
func (*Coingecko) UpdateHistoricalTokenTickers ¶ added in v0.4.0
UpdateHistoricalTokenTickers gets historical tickers for the tokens
type OnNewFiatRatesTicker ¶
type OnNewFiatRatesTicker func(ticker *common.CurrencyRatesTicker)
OnNewFiatRatesTicker is used to send notification about a new FiatRates ticker
type RatesDownloader ¶
type RatesDownloader struct {
// contains filtered or unexported fields
}
RatesDownloader stores FiatRates API parameters
func NewFiatRatesDownloader ¶
func NewFiatRatesDownloader(db *db.RocksDB, apiType string, params string, allowedVsCurrencies string, callback OnNewFiatRatesTicker) (*RatesDownloader, error)
NewFiatRatesDownloader initializes the downloader for FiatRates API.
func (*RatesDownloader) Run ¶
func (rd *RatesDownloader) Run() error
Run periodically downloads current (every 15 minutes) and historical (once a day) tickers
type RatesDownloaderInterface ¶
type RatesDownloaderInterface interface { CurrentTickers() (*common.CurrencyRatesTicker, error) UpdateHistoricalTickers() error UpdateHistoricalTokenTickers() error }
RatesDownloaderInterface provides method signatures for specific fiat rates downloaders
func NewCoinGeckoDownloader ¶
func NewCoinGeckoDownloader(db *db.RocksDB, url string, coin string, platformIdentifier string, platformVsCurrency string, allowedVsCurrencies string, timeFormat string, throttleDown bool) RatesDownloaderInterface
NewCoinGeckoDownloader creates a coingecko structure that implements the RatesDownloaderInterface