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

github.com/EricNeid/go-openweather

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/EricNeid/go-openweather

  • v0.2.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

Go Report Card Go Go Doc Release Gitpod Ready-to-Code

About

This Repo contains golang library to query OpenWetherMaps (http://openweathermap.org/) for weather information.

Install

go get github.com/EricNeid/openweather

Documentation

Is available on godoc:

https://godoc.org/github.com/EricNeid/go-openweather

Examples

Consuming the library:

import "github.com/EricNeid/openweather"

// create a query
q := openweather.NewQueryForCity(readAPIKey(), "Berlin,de")

// obtain data
resp, err := q.Weather()

// enjoy
fmt.Println(resp.Name) // Berlin
fmt.Println(resp.Weather[0].Description) // misc
fmt.Println(resp.Main.Temp) // 1

See the test files for more example.

A simple client for testing is also included:

go build cmd/openweatherclient
openweatherclient -key <OpenWeather API Key> -city Berlin,de

FAQs

Package last updated on 17 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