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

github.com/m3o-apis/weather-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/m3o-apis/weather-go

  • v0.0.0-20211027120904-20ed7e6efec0
  • Source
  • Go
  • Socket score

Version published
Created
Source

Weather

An m3o.com API. For example usage see m3o.com/Weather/api.

Endpoints:

Now

Get the current weather report for a location by postcode, city, zip code, ip address

https://m3o.com/weather/api#Now

package example

import(
	"fmt"
	"os"

	"github.com/micro/services/clients/go/weather"
)

// Get the current weather report for a location by postcode, city, zip code, ip address
func GetCurrentWeather() {
	weatherService := weather.NewWeatherService(os.Getenv("M3O_API_TOKEN"))
	rsp, err := weatherService.Now(&weather.NowRequest{
		Location: "london",

	})
	fmt.Println(rsp, err)
}

Forecast

Get the weather forecast for the next 1-10 days

https://m3o.com/weather/api#Forecast

package example

import(
	"fmt"
	"os"

	"github.com/micro/services/clients/go/weather"
)

// Get the weather forecast for the next 1-10 days
func ForecastWeather() {
	weatherService := weather.NewWeatherService(os.Getenv("M3O_API_TOKEN"))
	rsp, err := weatherService.Forecast(&weather.ForecastRequest{
		Days: 2,
Location: "London",

	})
	fmt.Println(rsp, err)
}

FAQs

Package last updated on 27 Oct 2021

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