config

package
v0.0.0-...-e22a3ac Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host        string `toml:"host"`
	Port        uint16 `toml:"port"`
	MaxClients  uint   `toml:"max_clients"`
	IdleTimeout uint   `toml:"idle_timeout"`

	LogLevel string `toml:"log_level"`

	OpenWeatherMap OpenWeatherMap
	HVAC           HVAC
	PulseCounter   PulseCounter
	WaterTank      WaterTank
}

func (*Config) LoadConfig

func (c *Config) LoadConfig(path string) (*Config, error)

func (*Config) MapLogLevel

func (c *Config) MapLogLevel(level string) log.Level

type HVAC

type HVAC struct {
	Enabled        bool    `toml:"enabled"`
	IdleCurrent    float32 `toml:"idle_current"`
	MaxFanSpeed    uint16  `toml:"max_fan_speed"`
	RoomTempOffset float32 `toml:"room_temp_offset"`
}

type OpenWeatherMap

type OpenWeatherMap struct {
	ApiKey string `tom:"api_key"`
	City   string `toml:"city"`
}

type PulseCounter

type PulseCounter struct {
	Enabled           bool    `toml:"enabled"`
	ChanceToIncrement float32 `toml:"chance_to_increment"`
}

type WaterTank

type WaterTank struct {
	Enabled            bool   `toml:"enabled"`
	MaxTankCapacity    uint16 `toml:"max_tank_capacity"`
	MaxWaterLevel      uint16 `toml:"max_water_level"`
	MinWaterLevel      uint16 `toml:"min_water_level"`
	MaxWaterLevelAlarm uint16 `toml:"max_water_level_alarm"`
	DrainRate          uint16 `toml:"drain_rate"`
	FillRate           uint16 `toml:"fill_rate"`
}

Jump to

Keyboard shortcuts

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