backfill

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxRetries = maxRetries

Functions

This section is empty.

Types

type Backfiller

type Backfiller struct {
	Client CovidGetter
	Store  CovidStoreAdder
}

Backfiller retrieves historic COVID19 data and adds it to the database

func New added in v1.0.0

func New(store CovidStoreAdder) *Backfiller

New creates a new Backfiller object

func (*Backfiller) Run

func (b *Backfiller) Run() error

Run the backfiller. Get all supported countries from the API Then add any historical record that is older than the first record in the DB

type Client added in v1.3.3

type Client struct {
	URL string
}

func (Client) GetCountries added in v1.3.3

func (c Client) GetCountries() (Countries, error)

func (Client) GetHistoricalData added in v1.3.3

func (c Client) GetHistoricalData(slug string) ([]CountryData, error)

type Countries added in v1.3.3

type Countries map[string]Country

type Country added in v1.3.3

type Country struct {
	Name string
	Code string
}

type CountryData added in v1.3.3

type CountryData struct {
	Date      time.Time
	Confirmed int64
	Recovered int64
	Deaths    int64
}

type CovidGetter added in v1.3.3

type CovidGetter interface {
	GetCountries() (Countries, error)
	GetHistoricalData(string) ([]CountryData, error)
}

type CovidStoreAdder added in v1.3.3

type CovidStoreAdder interface {
	Add([]models.CountryEntry) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳