A Pirate Weather API client in Go.
This assumes you already have a working Go environment, if not please see this page first.
go get github.com/shawntoffel/go-pirateweatherImport the package into your project:
import (
"github.com/shawntoffel/go-pirateweather"
)Create a new pirateweather client:
client := pirateweather.Client{}Build a request:
request := pirateweather.ForecastRequest{
Latitude: 40.7128,
Longitude: -74.0059,
}Get a forecast:
ctx := context.Background()
// The api token can be found on your Pirate Weather dashboard.
response, err := client.Forecast(ctx, apiToken, request)Please use the GitHub Discussions tab for questions regarding this client library.