weather

package
v0.0.0-...-49a0fbc Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt struct {
	ForecastInterval time.Duration
	MaxEntries       int

	CacheTTL   time.Duration
	ReqTimeout time.Duration
	UserAgent  string
}

Opt contains config options for Weather.

type Weather

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

Weather fetches weather forecasts for a given geo location.

func New

func New(o Opt, g *geo.Geo) *Weather

func (*Weather) Dump

func (w *Weather) Dump() ([]byte, error)

Dump produces a gob dump of the cached data.

func (*Weather) Load

func (w *Weather) Load(b []byte) error

Load loads a gob dump of cached data.

func (*Weather) Query

func (w *Weather) Query(q string) ([]string, error)

Query queries the weather for a given location.

Jump to

Keyboard shortcuts

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