weather

package
v0.0.0-...-f67e159 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClimateReport

type ClimateReport struct {
	Maximum        Measurement    `json:"maximum"`
	Minimum        Measurement    `json:"minimum"`
	Precipitations Precipitations `json:"precipitations"`
}

type ClimateStation

type ClimateStation struct {
	Code        int            `json:"code"`
	Name        string         `json:"name"`
	Operational bool           `json:"operational"`
	LastReport  *time.Time     `json:"last_report,omitempty"`
	Temperature float64        `json:"temperature,omitempty"`
	Humidity    float64        `json:"humidity,omitempty"`
	PressureHPA float64        `json:"pressure_hpa,omitempty"`
	Today       *ClimateReport `json:"today,omitempty"`
	Yesterday   *ClimateReport `json:"yesterday,omitempty"`
}

type DefaultService

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

func NewDefaultService

func NewDefaultService() *DefaultService

func (*DefaultService) GetClimateStations

func (s *DefaultService) GetClimateStations() ([]*ClimateStation, error)

type Handler

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

func NewHandler

func NewHandler(env *env.Env, service Service) *Handler

func (*Handler) Stations

func (h *Handler) Stations() gin.HandlerFunc

type Measurement

type Measurement struct {
	Time        time.Time `json:"time"`
	Temperature float64   `json:"temperature"`
}

type Precipitations

type Precipitations struct {
	Sum float64 `json:"sum"`
	EMA float64 `json:"ema"`
}

type Service

type Service interface {
	GetClimateStations() ([]*ClimateStation, error)
}

Jump to

Keyboard shortcuts

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