weather

package
v0.0.0-...-702564b Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Checker

type Checker interface {
	CheckByCurrentLocation() (*Weather, error)
	CheckByCoord(lat float64, long float64) (*Weather, error)
}

type OpenWeather

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

func NewOpenWeather

func NewOpenWeather(log log.Logger, httpClient *http.Client, location location.Locator) *OpenWeather

func (*OpenWeather) CheckByCoord

func (o *OpenWeather) CheckByCoord(lat float64, lon float64) (*Weather, error)

func (*OpenWeather) CheckByCurrentLocation

func (o *OpenWeather) CheckByCurrentLocation() (*Weather, error)

type OpenWeatherResponse

type OpenWeatherResponse struct {
	Weather []struct {
		Main        string `json:"main"`
		Description string `json:"description"`
	} `json:"weather"`
	Main struct {
		Temp float64 `json:"temp"`
	} `json:"main"`
}

type Weather

type Weather struct {
	Description string
	Temp        float64
}

Jump to

Keyboard shortcuts

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