services

package
v0.0.0-...-b36f183 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorJson

type ColorJson struct {
	BlackPercent float32 `json:"black_percent"`
	Colors       []struct {
		Color   []float32 `json:"color"`
		Percent float32   `json:"percent"`
	} `json:"colors"`
}

type ImageProcessor

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

func NewImageProcessingService

func NewImageProcessingService(config map[string]interface{}, errChan chan error, todayService *Today, weatherService *WeatherData) (*ImageProcessor, error)

func (*ImageProcessor) DateChangeNotifier

func (ip *ImageProcessor) DateChangeNotifier(notifier chan string)

func (*ImageProcessor) StartImageHandler

func (ip *ImageProcessor) StartImageHandler()

type MainSection

type MainSection struct {
	FeelsLike float32 `json:"feels_like"`
	Humidity  float32 `json:"humidity"`
	Pressure  int     `json:"pressure"`
	Temp      float32 `json:"temp"`
	TempMax   float32 `json:"temp_max"`
	TempMin   float32 `json:"temp_min"`
}

type Monitor

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

func NewMonitorService

func NewMonitorService(config map[string]interface{}, errChan chan error) (*Monitor, error)

func (*Monitor) SendFailure

func (m *Monitor) SendFailure(msg string) error

func (*Monitor) StartCronitorPing

func (m *Monitor) StartCronitorPing()

type PageData

type PageData struct {
	Today   string
	Sunrise string
	Sunset  string
}

type Params

type Params struct {
	Id    int    `url:"id,omitempty"`
	AppId string `url:"appid,omitempty"`
	Units string `url:"units,omitempty"`
}

type SysSection

type SysSection struct {
	Sunrise int64 `json:"sunrise"`
	Sunset  int64 `json:"sunset"`
}

type Today

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

func NewTodayService

func NewTodayService(wdService *WeatherData, config map[string]interface{}, errChan chan error) (*Today, error)

func (*Today) GetDarkPercent

func (t *Today) GetDarkPercent() float32

func (*Today) GetDate

func (t *Today) GetDate() string

func (*Today) GetHomeDirectory

func (t *Today) GetHomeDirectory() string

func (*Today) GetSunrise

func (t *Today) GetSunrise() int64

func (*Today) GetSunset

func (t *Today) GetSunset() int64

func (*Today) SetDarkPercent

func (t *Today) SetDarkPercent(percent float32)

func (*Today) SetOffline

func (t *Today) SetOffline()

func (*Today) SetOnline

func (t *Today) SetOnline() error

func (*Today) SetTodayPage

func (t *Today) SetTodayPage() error

SetTodayPage sets up an index.html for the static site with today's date and sunrise/sunset info

func (*Today) WatchDate

func (t *Today) WatchDate() chan string

WatchDate starts a goroutine that triggers the daily update of the index page

type Weather

type Weather struct {
	Main        MainSection   `json:"main"`
	Sys         SysSection    `json:"sys"`
	WeatherDesc []WeatherDesc `json:"weather"`
	Wind        WindSection   `json:"wind"`
}

type WeatherData

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

func NewWeatherDataService

func NewWeatherDataService(config map[string]interface{}, errChan chan error) (*WeatherData, error)

func (*WeatherData) GetCurrentTempStr

func (w *WeatherData) GetCurrentTempStr() (string, error)

func (*WeatherData) GetCurrentWeather

func (w *WeatherData) GetCurrentWeather() (*Weather, error)

type WeatherDesc

type WeatherDesc struct {
	Description string `json:"description"`
	Icon        string `json:"icon"`
	ID          int    `json:"id"`
	Main        string `json:"main"`
}

type WebEndpoint

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

func NewWebEndpoint

func NewWebEndpoint(tService *Today) *WebEndpoint

func (*WebEndpoint) StartWebHandler

func (we *WebEndpoint) StartWebHandler()

type WindSection

type WindSection struct {
	Deg   int     `json:"deg"`
	Gust  float64 `json:"gust"`
	Speed float64 `json:"speed"`
}

Jump to

Keyboard shortcuts

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