cfg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: GPL-3.0 Imports: 4 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 {
	Simulation      bool                       `yaml:"simulation"`
	DiskPowerStatus map[string]DiskPowerStatus `yaml:"disk_power_status"`
	Sensors         map[string]Task            `yaml:"sensors"`
	DiskPools       map[string][]string        `yaml:"disk_pools"`
	Disks           map[string]Disk            `yaml:"disks"`
	Templates       map[string]Template        `yaml:"templates"`
	Tasks           map[string]Task            `yaml:"tasks"`
	Schedule        map[string]Schedule        `yaml:"schedule"`
	FanControl      FanControl                 `yaml:"fan_control"`
}

Config from the file

func LoadFileConfig

func LoadFileConfig(fileName string) (Config, error)

LoadFileConfig loads the configuration from the file

type Disk

type Disk struct {
	Device             string `yaml:"device"`
	TemperatureSensor  string `yaml:"temperature_sensor"`
	MonitorTemperature string `yaml:"monitor_temperature"`
	LastActive         string `yaml:"last_active"`
	StandbyAfter       string `yaml:"standby_after"`
	PowerStatus        string `yaml:"power_status"`
}

Disk configuration

type DiskPowerStatus

type DiskPowerStatus struct {
	File           string `yaml:"file"`
	CheckCommand   string `yaml:"check_command"`
	Active         string `yaml:"active"`
	Standby        string `yaml:"standby"`
	Sleeping       string `yaml:"sleeping"`
	StandbyCommand string `yaml:"standby_command"`
	Timeout        string `yaml:"timeout"`
}

type FanControl

type FanControl struct {
	InitCommand string               `yaml:"init_command"`
	SetCommand  string               `yaml:"set_command"`
	ExitCommand string               `yaml:"exit_command"`
	Timeout     string               `yaml:"timeout"`
	Parameters  map[string]Parameter `yaml:"parameters"`
	Zones       map[string]FanZone   `yaml:"zones"`
}

type FanZone

type FanZone struct {
	ID           int               `yaml:"id"`
	MinSpeed     int               `yaml:"min_speed"`
	MaxSpeed     int               `yaml:"max_speed"`
	DefaultSpeed int               `yaml:"default_speed"`
	RunEvery     string            `yaml:"run_every"`
	Sensors      map[string]Sensor `yaml:"sensors"`
}

type FromTo

type FromTo struct {
	From int `yaml:"from"`
	To   int `yaml:"to"`
}

type Parameter

type Parameter struct {
	Format string `yaml:"format"`
}

type Schedule

type Schedule struct {
	Task string   `yaml:"task"`
	When []string `yaml:"when"`
}

type Sensor

type Sensor struct {
	Average  string       `yaml:"average"`
	RunEvery string       `yaml:"run_every"`
	Rules    []SensorRule `yaml:"rules"`
}

type SensorRule

type SensorRule struct {
	Temperature FromTo    `yaml:"temperature"`
	Fan         SetFromTo `yaml:"fan_speed"`
	RunEvery    string    `yaml:"run_every"`
}

type SetFromTo

type SetFromTo struct {
	Set  int `yaml:"set"`
	From int `yaml:"from"`
	To   int `yaml:"to"`
}

type Source

type Source struct {
	Template string `yaml:"template"`
}

type Task

type Task struct {
	Command     string   `yaml:"command"`
	File        string   `yaml:"file"`
	Files       []string `yaml:"files"`
	Stdin       Source   `yaml:"stdin"`
	Regexp      string   `yaml:"regexp"`
	Divider     int      `yaml:"divider"`
	Aggregation string   `yaml:"aggregation"`
	Timeout     string   `yaml:"timeout"`
}

type Template

type Template struct {
	Source string `yaml:"source"`
}

Jump to

Keyboard shortcuts

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