data

package
v0.0.0-...-c1d69a6 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Root                RepoPath = "tmp"
	DailyReports        RepoPath = "tmp/csse_covid_19_data/csse_covid_19_daily_reports"
	TimeSeries          RepoPath = "tmp/csse_covid_19_data/csse_covid_19_time_series"
	ConfirmedTimeSeries          = TimeSeries + "/time_series_covid19_confirmed_global.csv"
	DeathsTimeSeries             = TimeSeries + "/time_series_covid19_deaths_global.csv"
	RecoveredTimeSeries          = TimeSeries + "/time_series_covid19_recovered_global.csv"
)

Variables

View Source
var TimeSeriesPaths = map[TimeSeriesType]RepoPath{
	Confirmed: ConfirmedTimeSeries,
	Deaths:    DeathsTimeSeries,
	Recovered: RecoveredTimeSeries,
}

Functions

func Load

func Load() (Series, Series, Series)

func Update

func Update()

If the current instance already contains the repository, pull the latest changes from the repository If the current instance does not contain the repository, clone the repository

Types

type RepoPath

type RepoPath string

type Series

type Series struct {
	TimeSeriesType TimeSeriesType     `json:"-"`
	Records        []TimeSeriesRecord `json:"records"`
}

func (*Series) GetValueOfDate

func (s *Series) GetValueOfDate(country, state string, date time.Time) int

type TimeSeriesRecord

type TimeSeriesRecord struct {
	TimeSeriesType TimeSeriesType         `json:"-"`
	State          string                 `json:"state"`
	Country        string                 `json:"country"`
	Longitude      float32                `json:"long"`
	Latitude       float32                `json:"lat"`
	Total          int                    `json:"total"`
	Data           []TimeSeriesRecordData `json:"data"`
}

Single row in the time series.

type TimeSeriesRecordData

type TimeSeriesRecordData struct {
	Date  time.Time `json:"date"`
	Value int       `json:"value"`
}

Single day of data for a specific country/region

type TimeSeriesType

type TimeSeriesType string
const (
	Confirmed TimeSeriesType = "Confirmed"
	Deaths    TimeSeriesType = "Deaths"
	Recovered TimeSeriesType = "Recovered"
)

Jump to

Keyboard shortcuts

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