application

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

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

func NewApplication

func NewApplication(config *config.Config, logger *log.Logger, station *Station, mqtt *mqtt.MQTT) *Application

func (*Application) NewRouter

func (app *Application) NewRouter() *http.ServeMux

type Indoor

type Indoor struct {
	Temperature decimal.Decimal `json:"temperature"`
	Humidity    int             `json:"humidity"`
}

type Rain

type Rain struct {
	In        decimal.Decimal `json:"in"`
	InDaily   decimal.Decimal `json:"in_daily"`
	InWeekly  decimal.Decimal `json:"in_weekly"`
	InMonthly decimal.Decimal `json:"in_monthly"`
	InYearly  decimal.Decimal `json:"in_yearly"`
}

type Solar

type Solar struct {
	Radiation decimal.Decimal `json:"radiation"`
	UV        int             `json:"uv"`
}

type Station

type Station struct {
	Watchdog Watchdog
	Weather  *Weather
	// contains filtered or unexported fields
}

func NewStation

func NewStation(config *config.Station, logger *log.Logger) *Station

func (*Station) NewWeather

func (s *Station) NewWeather(r *http.Request) error

func (*Station) UpdateWatchDog

func (s *Station) UpdateWatchDog(success bool)

type Watchdog

type Watchdog struct {
	SuccessfulLastUpdate bool
	FailedAttempts       int
}

type Weather

type Weather struct {
	StationID   string          `json:"station_id"`
	Temperature decimal.Decimal `json:"temperature"`
	DewPoint    decimal.Decimal `json:"dew_point"`
	Humidity    int             `json:"humidity"`
	Pressure    decimal.Decimal `json:"pressure"`
	Wind        Wind            `json:"wind"`
	Rain        Rain            `json:"rain"`
	Solar       Solar           `json:"solar"`
	Indoor      Indoor          `json:"indoor"`
	UpdatedAt   time.Time       `json:"updated_at"`
}

type Wind

type Wind struct {
	Chill     decimal.Decimal `json:"chill"`
	Direction int             `json:"direction"`
	Speed     decimal.Decimal `json:"speed"`
	Gust      decimal.Decimal `json:"gust"`
}

Jump to

Keyboard shortcuts

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