Documentation ¶
Index ¶
- Constants
- func DetectAndReadConfigFile() string
- func GetFilePath() string
- func InitConfig(cfgFile string)
- func LoadConfig()
- func Validate(configPath string) error
- type ApiConfig
- type CmdFanConfig
- type CmdSensorConfig
- type Configuration
- type ControlAlgorithm
- type ControlAlgorithmConfig
- type ControlLoopConfig
- type CurveConfig
- type DirectControlAlgorithmConfig
- type ExecConfig
- type FanConfig
- type FileFanConfig
- type FileSensorConfig
- type FunctionCurveConfig
- type HwMonFanConfig
- type HwMonSensorConfig
- type LinearCurveConfig
- type PidControlAlgorithmConfig
- type PidCurveConfig
- type ProfilingConfig
- type SensorConfig
- type StatisticsConfig
Constants ¶
View Source
const ( // FunctionSum computes the sum of all referenced curves FunctionSum = "sum" // FunctionDifference computes the difference of all referenced curves FunctionDifference = "difference" // FunctionAverage computes the average value of all referenced // curves using the arithmetic mean FunctionAverage = "average" // FunctionDelta computes the difference between the biggest and the smallest // value of all referenced curves FunctionDelta = "delta" // FunctionMinimum computes the smallest value of all referenced curves FunctionMinimum = "minimum" // FunctionMaximum computes the biggest value of all referenced curves FunctionMaximum = "maximum" )
Variables ¶
This section is empty.
Functions ¶
func DetectAndReadConfigFile ¶
func DetectAndReadConfigFile() string
DetectAndReadConfigFile detects the path of the first existing config file
func GetFilePath ¶
func GetFilePath() string
GetFilePath this is only populated _after_ readInConfig()
func InitConfig ¶
func InitConfig(cfgFile string)
InitConfig reads in config file and ENV variables if set.
func LoadConfig ¶
func LoadConfig()
Types ¶
type CmdFanConfig ¶
type CmdFanConfig struct { SetPwm *ExecConfig `json:"setPwm,omitempty"` GetPwm *ExecConfig `json:"getPwm,omitempty"` GetRpm *ExecConfig `json:"getRpm,omitempty"` }
type CmdSensorConfig ¶
type Configuration ¶
type Configuration struct { DbPath string `json:"dbPath"` RunFanInitializationInParallel bool `json:"runFanInitializationInParallel"` MaxRpmDiffForSettledFan float64 `json:"maxRpmDiffForSettledFan"` FanResponseDelay int `json:"fanResponseDelay"` TempSensorPollingRate time.Duration `json:"tempSensorPollingRate"` TempRollingWindowSize int `json:"tempRollingWindowSize"` RpmPollingRate time.Duration `json:"rpmPollingRate"` RpmRollingWindowSize int `json:"rpmRollingWindowSize"` ControllerAdjustmentTickRate time.Duration `json:"controllerAdjustmentTickRate"` Fans []FanConfig `json:"fans"` Sensors []SensorConfig `json:"sensors"` Curves []CurveConfig `json:"curves"` Api ApiConfig `json:"api"` Statistics StatisticsConfig `json:"statistics"` Profiling ProfilingConfig `json:"profiling"` }
var CurrentConfig Configuration
type ControlAlgorithm ¶
type ControlAlgorithm string
const ( Pid ControlAlgorithm = "pid" Direct ControlAlgorithm = "direct" )
type ControlAlgorithmConfig ¶
type ControlAlgorithmConfig struct { Direct *DirectControlAlgorithmConfig `json:"direct,omitempty"` Pid *PidControlAlgorithmConfig `json:"pid,omitempty"` }
func (*ControlAlgorithmConfig) UnmarshalText ¶
func (s *ControlAlgorithmConfig) UnmarshalText(text []byte) error
UnmarshalText is a custom unmarshaler for ControlAlgorithmConfig to handle string enum values
type ControlLoopConfig ¶
type CurveConfig ¶
type CurveConfig struct { ID string `json:"id"` Linear *LinearCurveConfig `json:"linear,omitempty"` PID *PidCurveConfig `json:"pid,omitempty"` Function *FunctionCurveConfig `json:"function,omitempty"` }
type DirectControlAlgorithmConfig ¶
type DirectControlAlgorithmConfig struct {
MaxPwmChangePerCycle *int `json:"maxPwmChangePerCycle,omitempty"`
}
type ExecConfig ¶
type FanConfig ¶
type FanConfig struct { ID string `json:"id"` NeverStop bool `json:"neverStop"` // MinPwm defines the lowest PWM value where the fans are still spinning, when spinning previously MinPwm *int `json:"minPwm,omitempty"` // StartPwm defines the lowest PWM value where the fans are able to start spinning from a standstill StartPwm *int `json:"startPwm,omitempty"` // MaxPwm defines the highest PWM value that yields an RPM increase MaxPwm *int `json:"maxPwm,omitempty"` PwmMap *map[int]int `json:"pwmMap,omitempty"` Curve string `json:"curve"` ControlAlgorithm *ControlAlgorithmConfig `json:"controlAlgorithm,omitempty"` HwMon *HwMonFanConfig `json:"hwMon,omitempty"` File *FileFanConfig `json:"file,omitempty"` Cmd *CmdFanConfig `json:"cmd,omitempty"` // ControlLoop is a configuration for a PID control loop. // // Deprecated: HeaderMap exists for historical compatibility // and should not be used. To access the headers returned by a handler, // use the Response.Header map as returned by the Result method. ControlLoop *ControlLoopConfig `json:"controlLoop,omitempty"` }
type FileFanConfig ¶
type FileSensorConfig ¶
type FileSensorConfig struct {
Path string `json:"path"`
}
type FunctionCurveConfig ¶
type HwMonFanConfig ¶
type HwMonSensorConfig ¶
type LinearCurveConfig ¶
type PidCurveConfig ¶
type ProfilingConfig ¶
type SensorConfig ¶
type SensorConfig struct { ID string `json:"id"` HwMon *HwMonSensorConfig `json:"hwMon,omitempty"` File *FileSensorConfig `json:"file,omitempty"` Cmd *CmdSensorConfig `json:"cmd,omitempty"` }
type StatisticsConfig ¶
Click to show internal directories.
Click to hide internal directories.