Go Package to get information regarding the novel corona virus provided by Johns Hopkins university
Full Documentation can be found here
go get -u github.com/ahmednafies/go-covid/covid
data, err := covid.GetData()
if err != nil {
// Handle error here
}
fmt.Println(data)
data, err := covid.GetCountryByName("italy")
if err != nil {
// Handle error here
}
fmt.Println(data.Attrs.Id)
fmt.Println(data.Attrs.Country)
fmt.Println(data.Attrs.LastUpdate)
fmt.Println(data.Attrs.Confirmed)
fmt.Println(data.Attrs.Deaths)
fmt.Println(data.Attrs.Active)
fmt.Println(data.Attrs.Recovered)
fmt.Println(data.Attrs.Latitude)
fmt.Println(data.Attrs.Longitude)
113
Italy
1584216796000
21157
1441
17750
1966
41.8719
list, err := covid.ListCountries()
if err != nil {
// Handle error here
}
[
Attrs{
Id: 40
Name: Hungary
},
Attrs{
Id: 113
Name: Italy
}
...
]
data, err := covid.GetCountryById(113)
active, err := covid.GetTotalActive()
confirmed, err := covid.GetTotalConfirmed()
recovered, err := covid.GetTotalRecovered()
deaths, err := covid.GetTotalDeaths()