summaryrefslogtreecommitdiffstats
path: root/nws/nws.go
diff options
context:
space:
mode:
authorsiddharth ravikumar <s@ricketyspace.net>2022-06-07 01:05:31 -0400
committersiddharth ravikumar <s@ricketyspace.net>2022-06-07 01:05:41 -0400
commit55fc4b89102c9c19dc8d0ee59bc92ea58ce287c8 (patch)
tree23621f5c3e0813711d58d7a313a75225c5354d39 /nws/nws.go
parent521c07cbb8aa350939b21b569aa88ecd58978911 (diff)
nws: add `CacheWeather`
Diffstat (limited to 'nws/nws.go')
-rw-r--r--nws/nws.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/nws/nws.go b/nws/nws.go
index 8fec6ed..42317ac 100644
--- a/nws/nws.go
+++ b/nws/nws.go
@@ -80,6 +80,15 @@ func (e Error) Error() string {
return fmt.Sprintf("%d: %s: %s", e.Status, e.Type, e.Detail)
}
+func CacheWeather(lat, lng float32) {
+ p, err := Points(lat, lng)
+ if err != nil {
+ return
+ }
+ GetForecast(p)
+ GetForecastHourly(p)
+}
+
// NWS `/points` endpoint.
//
// TODO: return Error instead of error