weatherboard

package
v0.0.90 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	CurrentForecast(ctx context.Context, zipCode string, country string, bounds image.Rectangle, metricUnits bool) (*Forecast, error)
	DailyForecasts(ctx context.Context, zipCode string, country string, bounds image.Rectangle, metricUnits bool) ([]*Forecast, error)
	HourlyForecasts(ctx context.Context, zipCode string, country string, bounds image.Rectangle, metricUnits bool) ([]*Forecast, error)
	CacheClear()
}

API interface for getting weather data

type Config

type Config struct {
	StartEnabled       *atomic.Bool `json:"enabled"`
	BoardDelay         string       `json:"boardDelay"`
	ScrollMode         *atomic.Bool `json:"scrollMode"`
	TightScrollPadding int          `json:"tightScrollPadding"`
	ScrollDelay        string       `json:"scrollDelay"`
	ZipCode            string       `json:"zipCode"`
	Country            string       `json:"country"`
	APIKey             string       `json:"apiKey"`
	CurrentForecast    *atomic.Bool `json:"currentForecast"`
	HourlyForecast     *atomic.Bool `json:"hourlyForecast"`
	DailyForecast      *atomic.Bool `json:"dailyForecast"`
	DailyNumber        int          `json:"dailyNumber"`
	HourlyNumber       int          `json:"hourlyNumber"`
	OnTimes            []string     `json:"onTimes"`
	OffTimes           []string     `json:"offTimes"`
	MetricUnits        *atomic.Bool `json:"metricUnits"`
	ShowBetween        *atomic.Bool `json:"showBetween"`
	// contains filtered or unexported fields
}

Config for a WeatherBoard

func (*Config) SetDefaults

func (c *Config) SetDefaults()

SetDefaults ...

type Forecast

type Forecast struct {
	Time         time.Time
	Temperature  *float64
	HighTemp     *float64
	LowTemp      *float64
	Humidity     int
	TempUnit     string
	Icon         *logo.Logo
	IconCode     string
	IsHourly     bool
	PrecipChance *int
}

Forecast ...

type Server

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

Server ...

func (*Server) GetStatus

func (s *Server) GetStatus(ctx context.Context, req *emptypb.Empty) (*pb.StatusResp, error)

GetStatus ...

func (*Server) SetStatus

func (s *Server) SetStatus(ctx context.Context, req *pb.SetStatusReq) (*emptypb.Empty, error)

SetStatus ...

type WeatherBoard

type WeatherBoard struct {
	sync.Mutex
	// contains filtered or unexported fields
}

WeatherBoard displays weather

func New

func New(api API, config *Config, log *zap.Logger) (*WeatherBoard, error)

New ...

func (*WeatherBoard) Enabler

func (w *WeatherBoard) Enabler() board.Enabler

func (*WeatherBoard) GetHTTPHandlers

func (w *WeatherBoard) GetHTTPHandlers() ([]*board.HTTPHandler, error)

GetHTTPHandlers ...

func (*WeatherBoard) GetRPCHandler

func (w *WeatherBoard) GetRPCHandler() (string, http.Handler)

GetRPCHandler ...

func (*WeatherBoard) InBetween

func (w *WeatherBoard) InBetween() bool

InBetween ...

func (*WeatherBoard) Name

func (w *WeatherBoard) Name() string

Name ...

func (*WeatherBoard) Render

func (w *WeatherBoard) Render(ctx context.Context, canvas board.Canvas) error

Render ...

func (*WeatherBoard) ScrollMode

func (w *WeatherBoard) ScrollMode() bool

ScrollMode ...

func (*WeatherBoard) ScrollRender

func (w *WeatherBoard) ScrollRender(ctx context.Context, canvas board.Canvas, padding int) (board.Canvas, error)

ScrollRender ...

Jump to

Keyboard shortcuts

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