Added a /conditions/current endpoint with computed best-guess values for current conditions
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful

This commit is contained in:
2026-03-17 15:51:00 -05:00
parent e3aab86376
commit cb316c228a
19 changed files with 1146 additions and 358 deletions

View File

@@ -5,18 +5,39 @@ import (
"time"
)
type ObservationSummaryMetric struct {
type ObservationCurrentConditionsMetric struct {
TemperatureC *float64
ApparentTemperatureC *float64
DewpointC *float64
RelativeHumidity *float64
WindSpeedKmh *float64
WindDirectionDegrees *float64
ConditionCode *int
IsDay *bool
}
type ObservationConditionMetric struct {
StationID *string
ObservedAt time.Time
TemperatureC *float64
TextDescription *string
ProviderRawDescription *string
ConditionText *string
type ObservationPresentWeatherMetric struct {
Raw map[string]any
}
type ObservationRecordMetric struct {
EventID string
StationID *string
StationName *string
Timestamp time.Time
ConditionCode int
IsDay *bool
TextDescription *string
TemperatureC *float64
DewpointC *float64
WindDirectionDegrees *float64
WindSpeedKmh *float64
WindGustKmh *float64
BarometricPressurePa *float64
VisibilityMeters *float64
RelativeHumidityPercent *float64
ApparentTemperatureC *float64
PresentWeather []ObservationPresentWeatherMetric
}
type ForecastPeriodMetric struct {
@@ -60,9 +81,8 @@ type AlertRecord struct {
}
type ObservationRepository interface {
GetCurrentSummary(ctx context.Context, window time.Duration) (ObservationSummaryMetric, error)
ListCurrentConditions(ctx context.Context, window time.Duration) ([]ObservationConditionMetric, error)
ListCurrentPrecipitationEvents(ctx context.Context, window time.Duration) ([]string, error)
GetCurrentConditionsSummary(ctx context.Context, window time.Duration) (ObservationCurrentConditionsMetric, error)
ListRecentObservations(ctx context.Context, count int) ([]ObservationRecordMetric, error)
}
type ForecastRepository interface {