summaryrefslogtreecommitdiffstats
path: root/weather/weather.go
diff options
context:
space:
mode:
authorsiddharth ravikumar <s@ricketyspace.net>2022-06-12 19:44:30 -0400
committersiddharth ravikumar <s@ricketyspace.net>2022-06-12 19:44:30 -0400
commit2726d7d51bb89c0ab41783ab359b5ed7ad29a758 (patch)
treeb165f9521d5940a922b3f884d083e1705895c3d2 /weather/weather.go
parent16a8651571e7e489e1d22c5546db0153608bb48a (diff)
weather: update `Weather`
Add `SearchEnabled` field. Used to determined weather to render a link to the search or not.
Diffstat (limited to 'weather/weather.go')
-rw-r--r--weather/weather.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/weather/weather.go b/weather/weather.go
index 9cc6ebf..2eb2bf7 100644
--- a/weather/weather.go
+++ b/weather/weather.go
@@ -9,6 +9,7 @@ import (
"time"
"ricketyspace.net/peach/nws"
+ "ricketyspace.net/peach/photon"
"ricketyspace.net/peach/version"
)
@@ -19,6 +20,7 @@ type Weather struct {
Now WeatherNow
Q2HTimeline WeatherTimeline // Q2H forecast of the next 12 hours.
BiDailyTimeline WeatherTimeline // BiDaily forecast for the next 3 days.
+ SearchEnabled bool
}
type WeatherNow struct {
@@ -106,6 +108,7 @@ func NewWeather(lat, lng float32) (*Weather, error, int) {
w.BiDailyTimeline = WeatherTimeline{
Periods: bdPeriods,
}
+ w.SearchEnabled = photon.Enabled()
return w, nil, 200
}