openweathermap

package
v0.0.0-...-e5c115e Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAPIKeyMissing = errors.New("apiKey missing")

ErrAPIKeyMissing is returned by New if the API key is missing in the config.

Functions

func New

func New(config Config) (weather.Provider, error)

New creates a new weather.Provider from given config.

func NewFromConfig

func NewFromConfig(path string) (weather.Provider, error)

NewFromConfig creates a new weather.Provider from the config at given path.

Types

type Config

type Config struct {
	APIKey      string  `json:"apiKey"`
	CityID      string  `json:"cityID"`
	CityName    string  `json:"cityName"`
	CountryCode string  `json:"countryCode"`
	ZipCode     string  `json:"zipCode"`
	Latitude    float64 `json:"latitude"`
	Longitude   float64 `json:"longitude"`
}

Config for openweathermap.

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig loads the config at path.

Jump to

Keyboard shortcuts

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