Documentation ¶
Overview ¶
Package weather provides a collection of weather service implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidTemperature is thrown when the converted temperature exceeds the allowed value range. ErrInvalidTemperature = errors.New("given combination of value and unit of temperature invalid") // ErrNotFound is thrown when a city does not exist in the database. ErrNotFound = errors.New("given city could not be found") )
Functions ¶
This section is empty.
Types ¶
type InMemoryService ¶
type InMemoryService struct {
// contains filtered or unexported fields
}
InMemoryService is a in-memory implementation of a weather data service.
func NewInMemoryService ¶
func NewInMemoryService() *InMemoryService
NewInMemoryService creates a new InMemoryService.
func (*InMemoryService) Cities ¶
func (service *InMemoryService) Cities() []string
Cities returns a list of all stored cities.
func (*InMemoryService) TemperatureIn ¶
func (service *InMemoryService) TemperatureIn(city string, unit Unit) (Report, error)
TemperatureIn retrieves the current temperature in the city.
Click to show internal directories.
Click to hide internal directories.