weather

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Settings

type Settings struct {
	// contains filtered or unexported fields
}

func NewSettingsFromYAML

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

type Widget

type Widget struct {
	wtf.KeyboardWidget
	wtf.MultiSourceWidget
	wtf.TextWidget

	// APIKey   string
	Data []*owm.CurrentWeatherData
	// contains filtered or unexported fields
}

Widget is the container for weather data.

func NewWidget

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

NewWidget creates and returns a new instance of the weather Widget

func (*Widget) Fetch

func (widget *Widget) Fetch(cityIDs []int) []*owm.CurrentWeatherData

Fetch retrieves OpenWeatherMap data from the OpenWeatherMap API. It takes a list of OpenWeatherMap city IDs. It returns a list of OpenWeatherMap CurrentWeatherData structs, one per valid city code.

func (*Widget) HelpText added in v0.10.0

func (widget *Widget) HelpText() string

func (*Widget) Refresh

func (widget *Widget) Refresh()

Refresh fetches new data from the OpenWeatherMap API and loads the new data into the. widget's view for rendering

Jump to

Keyboard shortcuts

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