weather

package
v0.0.0-...-bb3eb04 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLocationNotFound is returned if the supplied lat/lon value can't be found.
	ErrLocationNotFound = status.New(codes.NotFound, "location not found")
)

Functions

This section is empty.

Types

type API

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

API is an implementation of the WeatherService server.

func NewAPI

func NewAPI(logger *zap.Logger) *API

NewAPI creates a new weather service server.

func (*API) GetCurrentReport

func (api *API) GetCurrentReport(ctx context.Context, req *GetCurrentReportRequest) (*GetCurrentReportResponse, error)

GetCurrentReport gets a weather report

func (*API) GetForecast

func (api *API) GetForecast(ctx context.Context, req *GetForecastRequest) (*GetForecastResponse, error)

GetForecast gets a weather forecast.

func (*API) RegisterStation

func (api *API) RegisterStation(s Station, latitude float64, longitude float64)

RegisterStation takes the supplied station and adds it to the queryable set.

type Station

type Station interface {
	Name() string
	GetReport(ctx context.Context) (*WeatherReport, error)
	GetForecast(ctx context.Context) ([]*WeatherForecast, error)
}

Station represents a single weather station location.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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