covid

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: MPL-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cases

type Cases struct {
	Latest Latest `json:"latest"`
}

Cases holds the latest cases

func LatestCases

func LatestCases() (*Cases, error)

LatestCases queries the /latest endpoint, does not take any query parameters

type Latest

type Latest struct {
	Confirmed int `json:"confirmed"`
	Deaths    int `json:"deaths"`
	// Not currently used but holds information about the country
	Locations []interface{} `json:"locations,omitempty"`
}

Latest holds the number of global confirmed cases and deaths due to Covid

type Settings

type Settings struct {
	*cfg.Common
	// contains filtered or unexported fields
}

Settings is the struct for this module's settings

func NewSettingsFromYAML

func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings

NewSettingsFromYAML returns the settings from the config yaml file

type Widget

type Widget struct {
	view.TextWidget
	// contains filtered or unexported fields
}

Widget is the struct that defines this module widget

func NewWidget

func NewWidget(app *tview.Application, settings *Settings) *Widget

NewWidget creates a new widget for this module

func (*Widget) LatestCountryCases

func (widget *Widget) LatestCountryCases(countries []interface{}) ([]*Cases, error)

LatestCountryCases queries the /locations endpoint, takes a query parameter: the country code

func (*Widget) Refresh

func (widget *Widget) Refresh()

Refresh checks if this module widget is disabled

func (*Widget) Render

func (widget *Widget) Render()

Render renders this module widget

Jump to

Keyboard shortcuts

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