Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { CommandLine string OutputRegexp *regexp.Regexp // contains filtered or unexported fields }
func NewCommand ¶
type CommandRunner ¶
type Control ¶
type Control struct { InitCommand CommandRunner SetCommand CommandRunner ExitCommand CommandRunner Zones map[string]*Zone // contains filtered or unexported fields }
Control temperature
func NewControl ¶
func NewControl(sensorReader SensorReader, config cfg.FanControl, simulate bool) (*Control, error)
NewControl creates a new fan controller from configuration
type Disk ¶
Disk activity and status
func NewDisk ¶
func NewDisk(global *Global, name string, config cfg.Disk, diskStatuses map[string]DiskStatuser) (*Disk, error)
NewDisk creates a new disk activity and status monitor
func (*Disk) HasForceStandby ¶
HasForceStandby returns true when the disk should be set to standby mode after a period of inactivity
func (*Disk) HasTemperature ¶
HasTemperature indicates if the disk accepts temperature readings.
func (*Disk) IsIdle ¶
IsIdle returns true when the disk hasn't been reading or writing for a set amount of time
func (*Disk) LastActivity ¶
LastActivity returns the last time the disk has been reading or writing
func (*Disk) StartStandbyWatch ¶
func (d *Disk) StartStandbyWatch()
func (*Disk) Temperature ¶
Temperature reads disk temperature (and keeps it in cache for about 1 minute)
func (*Disk) TemperatureAvailable ¶
TemperatureAvailable indicates if we can read the disk temperature now. In general it means the disk is not idle
type DiskPool ¶
func (*DiskPool) CountActive ¶
type DiskStatus ¶
type DiskStatus struct { Name string DiskActive string DiskStandby string DiskSleeping string File string // contains filtered or unexported fields }
func NewDiskStatus ¶
func NewDiskStatus(name string, config cfg.DiskPowerStatus) (*DiskStatus, error)
func (*DiskStatus) Get ¶
func (s *DiskStatus) Get(expandEnv func(string) string) enum.DiskStatus
type DiskStatuser ¶
type Diskstats ¶
type Diskstats struct {
// contains filtered or unexported fields
}
func (*Diskstats) IOActivityFrom ¶
func (*Diskstats) IOInProgress ¶
type Global ¶
type Global struct { Disks map[string]*Disk DiskPools map[string]*DiskPool Templates map[string]*Template Tasks map[string]*Task Schedules map[string]*Schedule DiskStatuses map[string]DiskStatuser TemperatureSensors map[string]SensorGetter FanControl *Control // contains filtered or unexported fields }
func (*Global) GetDiskstats ¶
func (*Global) GetSensorReader ¶
func (*Global) GetStartupTasks ¶
func (*Global) GetTimerTasks ¶
func (*Global) StartTimers ¶
func (g *Global) StartTimers()
type Rule ¶
type Rule struct { RunTimer time.Duration TemperatureFrom int TemperatureTo int FanFrom int FanTo int FanSet int // contains filtered or unexported fields }
Rule conversion from temperature to fan speed
func NewRule ¶
func NewRule(config cfg.SensorRule) (Rule, error)
NewRule creates a new rule to convert a temperature into a fan speed
func (Rule) CalculateFanSpeed ¶
CalculateFanSpeed from the rule. If the temperature is out of range it will return a min, max or set speed The second value returned is a request to change the temperature reading timer
func (Rule) MatchTemperature ¶
MatchTemperature is true when this rule matches the input temperature
type Sensor ¶
type Sensor struct { Name string Command CommandRunner File string AverageFiles []string // contains filtered or unexported fields }
Sensor reads value from the hardware (command line or sysfs file)
type SensorReader ¶
SensorReader is a function that takes a name and returns a function to read the named sensor
type Task ¶
type Task struct { Name string Command CommandRunner InputTemplate string // contains filtered or unexported fields }
type TemperatureSensor ¶
type TemperatureSensor struct { DefaultTimer time.Duration RunTimer time.Duration Name string Rules []Rule // contains filtered or unexported fields }
func NewTemperatureSensor ¶
func (*TemperatureSensor) Run ¶
func (s *TemperatureSensor) Run()
Run reads temperature and requests a change in fan speed. This method runs in a infinite loop and should be called inside a goroutine.
type Zone ¶
type Zone struct { ID int Name string Sensors map[string]*TemperatureSensor // contains filtered or unexported fields }
Zone fan control