services

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: BSL-1.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BetterUptimeResponse added in v0.3.5

type BetterUptimeResponse struct {
	Monitors []BetterUptimeSite `json:"data"`
}

type BetterUptimeSite added in v0.3.5

type BetterUptimeSite struct {
	MonitorType string `json:"type"`
	Attributes  struct {
		PronounceableName string `json:"pronounceable_name"`
		Url               string `json:"url"`
		Status            string `json:"status"`
	} `json:"attributes"`
}

type DepricatedUptimeConfig

type DepricatedUptimeConfig struct {
	APIKey         string `env:"UPTIMEROBOT_API_KEY"`
	UpdateInterval int    `env:"UPTIMEROBOT_UPDATE_INTERVAL" envDefault:"300"`
}

type DepricatedWeatherConfig

type DepricatedWeatherConfig struct {
	OpenWeather struct {
		Provider WeatherProvider `env:"OPENWEATHER_PROVIDER" envDefault:"openweathermap"`
		APIKey   string          `env:"OPENWEATHER_API_KEY"`
		Units    string          `env:"OPENWEATHER_TEMP_UNITS" envDefault:"metric"`
		Lat      float64         `env:"OPENWEATHER_LAT"`
		Lon      float64         `env:"OPENWEATHER_LON"`
	}
	UpdateInterval int `env:"OPENWEATHER_UPDATE_INTERVAL" envDefault:"15"`
}

type OpenWeatherResponse

type OpenWeatherResponse struct {
	Weather []struct {
		Name   string `json:"main"`
		IconId string `json:"icon"`
	} `json:"weather"`
	Main struct {
		Temp float64 `json:"temp"`
	} `json:"main"`
	Code    int    `json:"cod"`
	Message string `json:"message"`
}

type UptimeConfig

type UptimeConfig struct {
	Provider       string `env:"UPTIME_PROVIDER" envDefault:"uptimerobot"`
	APIKey         string
	UpdateInterval int `env:"UPTIME_UPDATE_INTERVAL" envDefault:"300"`
}

type UptimeManager

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

func NewUptimeManager

func NewUptimeManager(config *UptimeConfig) *UptimeManager

func (*UptimeManager) GetUptime

func (u *UptimeManager) GetUptime() []UptimeSite

type UptimeRobotResponse

type UptimeRobotResponse struct {
	Monitors []UptimeRobotSite `json:"monitors"`
}

type UptimeRobotSite

type UptimeRobotSite struct {
	FriendlyName string `json:"friendly_name"`
	Url          string `json:"url"`
	Status       int    `json:"status"`
}

type UptimeSite added in v0.3.5

type UptimeSite struct {
	FriendlyName string
	Url          string
	Up           bool
}

type WeatherConfig

type WeatherConfig struct {
	Provider       WeatherProvider `env:"WEATHER_PROVIDER" envDefault:"openweathermap"`
	APIKey         string          `env:"WEATHER_API_KEY"`
	Units          string          `env:"WEATHER_TEMP_UNITS" envDefault:"metric"`
	Lat            float64         `env:"WEATHER_LAT"`
	Lon            float64         `env:"WEATHER_LON"`
	UpdateInterval int             `env:"WEATHER_UPDATE_INTERVAL" envDefault:"15"`
}

type WeatherData

type WeatherData struct {
	Temperature float64
	WeatherText string
	Icon        string
}

type WeatherManager

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

func NewWeatherManager

func NewWeatherManager(config *WeatherConfig) *WeatherManager

func (*WeatherManager) GetWeather

func (c *WeatherManager) GetWeather() WeatherData

type WeatherProvider

type WeatherProvider string
const (
	OpenWeatherMap WeatherProvider = "openweathermap"
)

Jump to

Keyboard shortcuts

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