weather

package module
v0.0.0-...-049609f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

README

weather

Use weather to see current weather conditions on the command line.

Go Report Card Build Status GoDoc NetflixOSS Lifecycle GitHub

Project Overview

Module gophers.dev/cmds/weather provides a command-line utility for reporting current weather conditions.

The weather command can be tweaked to report on a specified location, and the output customized.

Getting Started

The weather command can be installed by running

go install gophers.dev/cmds/weather@latest

The use of weather requires a free token from openweathermap

Example Usages

get the weather for Austin, TX
$ cat ~/.weather.json
{
  "token": "<token>",
  "zip": "78701",
  "units": "imperial"
}

$ weather
overcast clouds -- 49.0 °F

Contributing

The gophers.dev/cmds/weather module is always improving with new features and error corrections. For contributing bug fixes and new features please file an issue.

License

The gophers.dev/cmds/weather module is open source under the MIT

Documentation

Index

Constants

View Source
const (
	OpenWeatherMapHost = "api.openweathermap.org"
	OpenWeatherMapPath = "data/2.5/weather"
)

Variables

View Source
var LookIn = filepath.Join(os.Getenv("HOME"), ".weather.json")

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Host    string `json:"host"`
	Path    string `json:"path"`
	Token   string `json:"token"`
	ZipCode string `json:"zip"`
	Units   string `json:"units"`
}

func LoadConfiguration

func LoadConfiguration(data []byte) (*Configuration, error)

type Tool

type Tool struct {
	// contains filtered or unexported fields
}

func NewTool

func NewTool(c *Configuration) *Tool

func (*Tool) Run

func (t *Tool) Run() error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL