Added wind route and started forecast endpoint

This commit is contained in:
2025-06-17 17:38:31 +02:00
parent cbafd785b9
commit 9e419ec7bf
9 changed files with 378 additions and 18 deletions

View File

@@ -6,7 +6,7 @@ import (
// CacheType, representing the abstract value of a CacheEntity
type CacheType interface {
Weather | Metrics
Weather | Metrics | Wind | Forecast
}
// CacheEntity, representing the value of the cache
@@ -22,14 +22,18 @@ type Cache[T CacheType] struct {
// Caches, representing a grouping of the various caches
type Caches struct {
WeatherCache Cache[Weather]
MetricsCache Cache[Metrics]
WeatherCache Cache[Weather]
MetricsCache Cache[Metrics]
WindCache Cache[Wind]
ForecastCache Cache[Forecast]
}
func InitCache() *Caches {
return &Caches{
WeatherCache: Cache[Weather]{Data: make(map[string]CacheEntity[Weather])},
MetricsCache: Cache[Metrics]{Data: make(map[string]CacheEntity[Metrics])},
WeatherCache: Cache[Weather]{Data: make(map[string]CacheEntity[Weather])},
MetricsCache: Cache[Metrics]{Data: make(map[string]CacheEntity[Metrics])},
WindCache: Cache[Wind]{Data: make(map[string]CacheEntity[Wind])},
ForecastCache: Cache[Forecast]{Data: make(map[string]CacheEntity[Forecast])},
}
}