All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
75 lines
2.3 KiB
Go
75 lines
2.3 KiB
Go
package ports
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
type ObservationSummaryMetric struct {
|
|
TemperatureC *float64
|
|
ApparentTemperatureC *float64
|
|
}
|
|
|
|
type ObservationConditionMetric struct {
|
|
StationID *string
|
|
ObservedAt time.Time
|
|
TemperatureC *float64
|
|
TextDescription *string
|
|
ProviderRawDescription *string
|
|
ConditionText *string
|
|
}
|
|
|
|
type ForecastPeriodMetric struct {
|
|
PeriodIndex int
|
|
StartTime time.Time
|
|
EndTime time.Time
|
|
Name *string
|
|
IsDay *bool
|
|
ConditionCode int
|
|
ConditionText *string
|
|
ProviderRawDescription *string
|
|
TextDescription *string
|
|
DetailedText *string
|
|
IconURL *string
|
|
TemperatureC *float64
|
|
TemperatureCMin *float64
|
|
TemperatureCMax *float64
|
|
DewpointC *float64
|
|
RelativeHumidityPercent *float64
|
|
WindDirectionDegrees *float64
|
|
WindSpeedKmh *float64
|
|
WindGustKmh *float64
|
|
BarometricPressurePa *float64
|
|
VisibilityMeters *float64
|
|
ApparentTemperatureC *float64
|
|
CloudCoverPercent *float64
|
|
ProbabilityOfPrecipitationPercent *float64
|
|
PrecipitationAmountMm *float64
|
|
SnowfallDepthMm *float64
|
|
UVIndex *float64
|
|
}
|
|
|
|
type AlertRecord struct {
|
|
Effective *time.Time
|
|
Expires *time.Time
|
|
Severity *string
|
|
Event *string
|
|
Headline *string
|
|
Instruction *string
|
|
Description *string
|
|
}
|
|
|
|
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)
|
|
}
|
|
|
|
type ForecastRepository interface {
|
|
ListForecastPeriodsAt(ctx context.Context, ts time.Time, limit int) ([]ForecastPeriodMetric, error)
|
|
}
|
|
|
|
type AlertRepository interface {
|
|
ListCurrentAlerts(ctx context.Context) ([]AlertRecord, error)
|
|
}
|