barista.run: barista.run/modules/weather/darksky Index | Files

package darksky

import "barista.run/modules/weather/darksky"

Package darksky provides weather using the Dark Sky API, available at https://darksky.net/.

Index

Package Files

darksky.go

type Config Uses

type Config string

Config represents Dark Sky API configuration (just the API key) from which a weather.Provider can be built.

func New Uses

func New(apiKey string) Config

New creats a new DarkSky API configuration.

func (Config) Coords Uses

func (c Config) Coords(lat, lon float64) weather.Provider

Coords creates a dark sky configuration for the given geographical co-ordinates.

type Provider Uses

type Provider string

Provider wraps a Dark Sky API url so that it can be used as a weather.Provider.

func (Provider) GetWeather Uses

func (ds Provider) GetWeather() (weather.Weather, error)

GetWeather gets weather information from DarkSky.

Package darksky imports 7 packages (graph). Updated 2018-09-20. Refresh now. Tools for package owners.