forecast

package
v0.0.0-...-f9dd335 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ApiKey    string
	City      string
	Units     UnitsOfMeasurment
	UseCoords bool
	Lon, Lat  float64
}

type Forecast

type Forecast struct {
	Temperature struct {
		Actual    float32 `json:"temp"`
		FeelsLike float32 `json:"feels_like"`
	} `json:"main"`
	Weather []struct {
		Main        string `json:"main"`
		Description string `json:"description"`
	} `json:"weather"`
	Sys struct {
		CountryCode string `json:"country"`
	} `json:"sys"`
	City string `json:"name"`
}

func GetForecast

func GetForecast(config *Config) (forecast *Forecast, err error)

type UnitsOfMeasurment

type UnitsOfMeasurment uint8
const (
	UnitsStandard UnitsOfMeasurment = iota
	UnitsMetric
	UnitsImperial
)

func ParseUnits

func ParseUnits(s string) (units UnitsOfMeasurment, err error)

func (UnitsOfMeasurment) Letter

func (u UnitsOfMeasurment) Letter() (r rune)

func (UnitsOfMeasurment) String

func (u UnitsOfMeasurment) String() (s string)

Jump to

Keyboard shortcuts

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