35 lines
643 B
Go
35 lines
643 B
Go
package providers
|
|
|
|
import "time"
|
|
|
|
type Site struct {
|
|
Name string
|
|
Latitude float64
|
|
Longitude float64
|
|
}
|
|
|
|
type HourlyForecastPoint struct {
|
|
TS time.Time
|
|
TempC *float64
|
|
RH *float64
|
|
PressureMSLH *float64
|
|
WindMS *float64
|
|
WindGustMS *float64
|
|
WindDirDeg *float64
|
|
PrecipMM *float64
|
|
PrecipProb *float64
|
|
CloudCover *float64
|
|
}
|
|
|
|
type ForecastResult struct {
|
|
RetrievedAt time.Time
|
|
Model string
|
|
Hourly []HourlyForecastPoint
|
|
Raw map[string]any
|
|
}
|
|
|
|
type Provider interface {
|
|
Name() string
|
|
Fetch(ctxDone <-chan struct{}, site Site, model string) (*ForecastResult, error)
|
|
}
|