owm

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	OneCall *onecall.Client
	Geo     *geo.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts *ClientOptions) *Client

func (*Client) GetWeather

func (c *Client) GetWeather(query string, opts *onecall.OneCallOptions) (*GeoDirectOneCallResponse, error)

GetWeather is an opinionated convenience function that first performs geocoding and then gets the One Call forecast.

func (*Client) WithGeo

func (c *Client) WithGeo(opts *geo.ClientOptions) *Client

func (*Client) WithOneCall

func (c *Client) WithOneCall(opts *onecall.ClientOptions) *Client

type ClientOptions

type ClientOptions struct {
	HttpClient *http.Client
	AppID      string // Your OpenWeather API key. May also be set as environment variable.
	Logger     *slog.Logger
}

type GeoDirectOneCallResponse

type GeoDirectOneCallResponse struct {
	GeoDirect *geo.GeoData
	OneCall   *onecall.OneCallResponse
}

Jump to

Keyboard shortcuts

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