Dark Sky API client
Clone or download
shawntoffel Merge pull request #12 from shawntoffel/dev
Added go mod files & updated travis config to test go 1.11
Latest commit 0c1f449 Sep 22, 2018

README.md

DarkSky

GoDoc Go Report Card Build Status

Dark Sky API client in Go https://darksky.net/dev/docs

Installing

This assumes you already have a working Go environment, if not please see this page first.

go get will always pull the latest released version from the master branch.

go get github.com/shawntoffel/darksky

If you want to use the dev branch, follow these steps next.

cd $GOPATH/src/github.com/shawntoffel/darksky
git checkout dev

Usage

Import the package into your project.

import "github.com/shawntoffel/darksky"

Construct a new DarkSky client

client := darksky.New("api key")

Build a request

request := darksky.ForecastRequest{}
request.Latitude = 40.7128
request.Longitude = -74.0059
request.Options = darksky.ForecastRequestOptions{Exclude: "hourly,minutely"}

Get the forecast

forecast, err := client.Forecast(request)