Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/twpayne/go-darksky

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/twpayne/go-darksky

  • v1.2.1
  • Source
  • Go
  • Socket score

Version published
Created
Source

go-darksky

PkgGoDev Coverage Status

Package darksky implements a client for the Dark Sky weather forecasting API.

Key features

  • Support for all Dark Sky API functionality.
  • Idomatic Go API, including support for context and Go modules.
  • Language matching.
  • Rich handling of errors, including both bad requests generic HTTP errors.
  • Fully tested, including error conditions.
  • Mock client for offline testing.
  • Monitoring hooks.

Example

func ExampleClient_Forecast() {
	c := darksky.NewClient(
		darksky.WithKey(os.Getenv("DARKSKY_KEY")),
	)

	ctx := context.Background()
	forecast, err := c.Forecast(ctx, 42.3601, -71.0589, nil, &darksky.ForecastOptions{
		Units: darksky.UnitsSI,
	})
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(forecast)
}

License

MIT

FAQs

Package last updated on 28 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc