fiat

package
v0.0.0-...-fa8983d Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: AGPL-3.0 Imports: 10 Imported by: 1

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

type OnNewFiatRatesTicker

type OnNewFiatRatesTicker func(ticker *db.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, startTime *time.Time, callback OnNewFiatRatesTicker) (*RatesDownloader, error)

NewFiatRatesDownloader initiallizes the downloader for FiatRates API. If the startTime is nil, the downloader will start from the beginning.

func (*RatesDownloader) Run

func (rd *RatesDownloader) Run() error

Run starts the FiatRates downloader. If there are tickers available, it continues from the last record. If there are no tickers, it finds the earliest market data available on API and downloads historical data. When historical data is downloaded, it continues to fetch the latest ticker prices.

type RatesDownloaderInterface

type RatesDownloaderInterface interface {
	// contains filtered or unexported methods
}

RatesDownloaderInterface provides method signatures for specific fiat rates downloaders

func NewCoinGeckoDownloader

func NewCoinGeckoDownloader(url string, coin string, timeFormat string) RatesDownloaderInterface

NewCoinGeckoDownloader creates a coingecko structure that implements the RatesDownloaderInterface

Jump to

Keyboard shortcuts

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