Documentation ¶
Index ¶
- type Context
- type Worker
- func (w *Worker) GetIBCTokensList() ([]types.ChainRegistryAsset, error)
- func (w *Worker) QueryAndSaveLatestIBCTokensInfo() error
- func (w *Worker) QueryCoinGeckoForIBCTokensDetails(ids []types.ChainRegistryAsset) error
- func (w Worker) StartFetchingLatestIBCTokensInfo() error
- func (w Worker) StartFetchingPrices() error
- func (w Worker) StartWorker()
- func (w Worker) UpdateTokenPrices() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
Context represents the context that is shared with worker
func NewWorkerContext ¶
NewWorkerContext builds new Context instance
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker defines a job consumer that is responsible for getting latest IBC token price data and exporting it to a database.
func (*Worker) GetIBCTokensList ¶
func (w *Worker) GetIBCTokensList() ([]types.ChainRegistryAsset, error)
GetIBCTokensList queries the latest IBC chain list and latest IBC token details from the given endpoint
func (*Worker) QueryAndSaveLatestIBCTokensInfo ¶
QueryAndSaveLatestIBCTokensInfo queries the latest IBC token details from the given endpoint and stores them inside the database
func (*Worker) QueryCoinGeckoForIBCTokensDetails ¶
func (w *Worker) QueryCoinGeckoForIBCTokensDetails(ids []types.ChainRegistryAsset) error
QueryCoinGeckoForIBCTokensDetails queries the remote APIs to get the latest IBC tokens details and stores updated values in database
func (Worker) StartFetchingLatestIBCTokensInfo ¶
StartFetchingLatestIBCTokensInfo starts the cron job that fetches and storees latest IBC tokens info inside the database once a day
func (Worker) StartFetchingPrices ¶
StartFetchingPrices starts the cron job that fetches and storees tokens prices every 5 minutes
func (Worker) StartWorker ¶
func (w Worker) StartWorker()
StartWorker starts a worker that triggers periodic operations to update the IBC tokens info and price stored in database in given interval. It returns an error if any export process fails.
func (Worker) UpdateTokenPrices ¶
UpdateTokenPrices queries latest IBC token prices and stores updated values in database