who

package
v0.0.0-...-2369477 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Date               float64 `json:"date"`
	Region             *string `json:"region"`
	DeathDailyIncrease float64 `json:"death_daily_increase"`
	TotalDeaths        float64 `json:"total_deaths"`
	CaseDailyIncrease  float64 `json:"case_daily_increase"`
	TotalCases         float64 `json:"total_cases"`
}

Data struct

type HistoryData

type HistoryData struct {
	Country     string        `json:"country"`
	CountryInfo jsons.Country `json:"country_info"`
	Data        []Data        `json:"data"`
}

HistoryData struct

func (*HistoryData) Latest

func (h *HistoryData) Latest() Data

Latest get latest / last data from array

func (*HistoryData) Simplify

func (h *HistoryData) Simplify() *SimpleHistoryData

Simplify simplify data to reduce size

type Service

type Service interface {
	History() (*[]HistoryData, error)
	Find(string) (*HistoryData, error)
}

Service interface

func NewService

func NewService(h http.Client, list jsons.CountryList) Service

NewService create new service

type SimpleData

type SimpleData struct {
	Cases  map[string]float64 `json:"cases"`
	Deaths map[string]float64 `json:"deaths"`
}

SimpleData struct

type SimpleHistoryData

type SimpleHistoryData struct {
	Country     string        `json:"country"`
	CountryInfo jsons.Country `json:"country_info"`
	Data        SimpleData    `json:"data"`
}

SimpleHistoryData struct

Jump to

Keyboard shortcuts

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