/sunset

Retrieve crepscular timings from sunrise-sunset.org

Primary LanguageGoMIT LicenseMIT

Sunset

Retrieve crepscular timings from sunrise-sunset.org

Godoc

Design

This package is designed to be able to automatically retrieve Sunset timings based upon your current GeoIP. Each type and method is separately exported, so you can insert your own logic anywhere in the chain. For an example of how the chain ties together, see sunset/sunset.go

For an explanation of the different times returned, please see MrReid.org's explanations

APIs

freegeoip.go: GeoIP infromation from freegeoip.net. Works around IPv6 limitations.

ipify.go: Your current IPv4 from ipify.org. Used to work around FreeGeoIP's IPv6 issues.

sunrise-sunset.go: Sunrise timings from sunrise-sunset.org. Times are in UTC and must be converted with .Local().

Use

Go Get: go get -u github.com/bmhatfield/sunset

CLI: go run print-sunset.go

API: sunset.Time()