weather

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeocodeZip

func GeocodeZip(zipCode string) (float64, float64, string, string, error)

GeocodeZip converts a ZIP code to coordinates and location information

func GetAlertDisplay

func GetAlertDisplay(alerts []Alert) (emoji string, color lipgloss.Color, text string)

GetAlertDisplay returns emoji, color, and text for weather alerts

func GetEmoji

func GetEmoji(conditions string) string

GetEmoji returns the appropriate emoji for weather conditions

func GetNearestRadarStation

func GetNearestRadarStation(lat, lon float64) (string, error)

GetNearestRadarStation returns the nearest NWS radar station for given coordinates

func GetWindArrow

func GetWindArrow(degrees int) string

GetWindArrow returns the unicode arrow for a compass direction in degrees

Types

type Alert

type Alert struct {
	Event       string
	Severity    string
	Urgency     string
	Headline    string
	Description string
	Expires     time.Time
}

Alert represents a weather alert

func FetchAlerts

func FetchAlerts(lat, lon float64) []Alert

FetchAlerts fetches weather alerts for the given coordinates

type ForecastPeriod

type ForecastPeriod struct {
	Name        string
	Temperature int
	TempUnit    string
	WindSpeed   string
	WindDir     string
	ShortFcast  string
	IsDaytime   bool
}

ForecastPeriod represents a single forecast period

func FetchForecast

func FetchForecast(lat, lon float64) []ForecastPeriod

FetchForecast fetches a compact forecast for the given coordinates

type WindData

type WindData struct {
	Speed     float64 // in mph
	Direction int     // in degrees (0=N, 90=E, 180=S, 270=W)
	Arrow     string  // unicode arrow
}

WindData holds wind speed and direction

func FetchCurrentConditions

func FetchCurrentConditions(lat, lon float64) (int, string, WindData)

FetchCurrentConditions fetches current weather conditions for the given coordinates

Jump to

Keyboard shortcuts

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