Initial MVP commit
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
74
internal/core/ports/ports.go
Normal file
74
internal/core/ports/ports.go
Normal file
@@ -0,0 +1,74 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user