Go client for the stormglass.io v2 REST API see documentation for more information.
This library is currently a work in progress. See the status section for more information and what endpoints are implemented.
go get github.com/yawlhead91/stormglassgo
package main
import (
"context"
"log"
"time"
stormglass "github.com/yawlhead91/stormglassgo"
)
const (
lat = 58.7984
lng = 17.8081
key = "..."
)
func main() {
start := time.Now()
end := time.Now().Add(time.Hour)
client := stormglass.NewClient(key)
ctx := context.Background()
points, err := client.GetPoint(ctx, stormglass.PointsRequestOptions{
Lat: lat,
Lng: lng,
Params: stormglass.ParamsOptions{
AirTemperature: true,
},
Start: &start,
End: &end,
Source: stormglass.SourcesOptions{
ICON: true,
},
})
if err != nil {
log.Fatalf("get weather points: %v", err)
}
for _, p := range points.Hours {
log.Printf("%+v", p)
}
}
- GET /weather/point
- GET /bio/point
- GET /tide/extremes/point
- GET /tide/sea-level/point
- GET /tide/sea-level/stations
- GET /tide/sea-level/stations/area
- GET /tide/astronomy/point
- GET /tide/solar/point
- GET /tide/elevation/point
All contributions are welcome following the existing code style and conventions and submit a PR.