Added metrics route
This commit is contained in:
@@ -54,13 +54,9 @@ func (cache *Cache[T]) GetEntry(key string, ttl int8) (T, bool) {
|
||||
func (cache *Cache[T]) AddEntry(entry T, cityName string) {
|
||||
currentTime := time.Now()
|
||||
|
||||
switch any(entry).(type) {
|
||||
case Weather:
|
||||
{
|
||||
cache.Data[cityName] = CacheEntity[T]{
|
||||
Element: entry,
|
||||
Timestamp: currentTime,
|
||||
}
|
||||
}
|
||||
cache.Data[cityName] = CacheEntity[T]{
|
||||
Element: entry,
|
||||
Timestamp: currentTime,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ type Metrics struct {
|
||||
Humidity string `json:"humidity"`
|
||||
Pressure string `json:"pressure"`
|
||||
DewPoint string `json:"dewPoint"`
|
||||
UvIndex int8 `json:"uvIndex"`
|
||||
UvIndex string `json:"uvIndex"`
|
||||
Visibility string `json:"visibility"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user