Skip to content
/ Govid Public

A simple Go lib to get information on Covid-19

License

Notifications You must be signed in to change notification settings

Yeffian/Govid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Govid

A simple Go library which lets you get information on Covid-19

Examples

Getting total data about all countires:

package main

import (
	"github.com/YeffyCodeGit/Govid/govid"
	"fmt"
)

func main() {
	data, err := govid.GetGlobalData()

	if err != nil {
		panic(err)
	}

	fmt.Printf("%+v", data)
}

Getting data about a specific country:

package main

import (
	"github.com/YeffyCodeGit/Govid/govid"
	"fmt"
)

func main() {
	data, err := govid.GetCountryData("Bangladesh")

	if err != nil {
		panic(err)
	}

	fmt.Printf("%+v", data)
}

Getting data about all the countries in the library

package main

import (
	"github.com/YeffyCodeGit/Govid/govid"
	"fmt"
)

func main() {
	data, err := govid.GetAllCountriesData()

	if err != nil {
		panic(err)
	}

	fmt.Printf("%+v", data)
}

Getting data about a specific amount of countries

package main

import (
    "github.com/YeffyCodeGit/Govid/govid"
    "fmt"
)

func main() {
	data, err := govid.GetCountryDataByLimit(2)
	
	if err != nil { panic(err) }
	
	fmt.Printf("%+v", data)
}

Installing the package

go get github.com/YeffyCodeGit/Govid

Building from source

First, clone the repo:

git clone https://github.com/YeffyCodeGit/Govid

Run the unit tests:

go test ./govid/tests

Credits

Thanks to https://github.com/WaifuShork for helping me on this project This project uses the Covid-19 API by Javier Aviles. You can find it here: https://github.com/javieraviles/covidAPI

About

A simple Go lib to get information on Covid-19

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published