Skip to content
This repository has been archived by the owner on Nov 21, 2021. It is now read-only.
/ darksky Public archive

A Go(lang) Client API for Dark Sky weather forecasts.

Notifications You must be signed in to change notification settings

larrymyers/darksky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DarkSky API for Go

Requirements

Usage

import "go.larrymyers.com/darksky"

r := darksky.MakeRequest("my_key", "41.8781", "-87.6297").Get()

feelsLike := r.Forecast.Currently.ApparentTemperature

// All time fields are represented as seconds since epoch, so
// conversion to a time.Time representation is straight forward.
currentTime := time.Unix(r.Forecast.Currently.Time, 0)

fmt.Printf("It feels like %v degrees outside at %v.", feelsLike, currentTime)

Notes

All time based fields are stored as int64 values, which contain the seconds since epoch.

Conversion can be done using time.Unix.

Run Tests With Coverage

go test -coverprofile=cover.out && go tool cover -html=cover.out

About

A Go(lang) Client API for Dark Sky weather forecasts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages