weather

package
v3.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AstroToPoints

func AstroToPoints(aes []AstroEvent, options WriteOptions) []*write.Point

func RecordsToPoints

func RecordsToPoints(rs []Record, options WriteOptions) []*write.Point

func SetDewpoint

func SetDewpoint(r *Record, v float64)

func SetFeelsLike

func SetFeelsLike(r *Record, v float64)

func SetIceAmount

func SetIceAmount(r *Record, v float64)

func SetPrecipitationProbability

func SetPrecipitationProbability(r *Record, v float64)

func SetPreciptationAmount

func SetPreciptationAmount(r *Record, v float64)

func SetSkyCover

func SetSkyCover(r *Record, v float64)

func SetSnowAmount

func SetSnowAmount(r *Record, v float64)

func SetTemperature

func SetTemperature(r *Record, v float64)

func SetWindDirection

func SetWindDirection(r *Record, v float64)

func SetWindGust

func SetWindGust(r *Record, v float64)

func SetWindSpeed

func SetWindSpeed(r *Record, v float64)

Types

type AstroEvent

type AstroEvent struct {
	Time   time.Time
	SunUp  *int
	MoonUp *int
	// this is hard to name. It's not "how bright is the moon" - it's "ratio of current moon phase to the full moon".
	FullMoonRatio *float64
}

type Astrocaster

type Astrocaster interface {
	Initer
	GetAstrocast() ([]AstroEvent, error)
}

type Forecaster

type Forecaster interface {
	Initer
	GetWeather() ([]Record, error)
}

type Initer

type Initer interface {
	Init(lat string, lon string, retryer http.Retryer) error
}

type Record

type Record struct {
	Time                     time.Time
	Temperature              *float64
	Dewpoint                 *float64
	FeelsLike                *float64
	SkyCover                 *float64
	WindDirection            *float64
	WindSpeed                *float64
	WindGust                 *float64
	PrecipitationProbability *float64
	PrecipitationAmount      *float64
	SnowAmount               *float64
	IceAmount                *float64
}

type WriteOptions

type WriteOptions struct {
	ForecastSource  string
	MeasurementName string
	Location        string
	ForecastTime    *string
}

Jump to

Keyboard shortcuts

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