Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckProcess ¶
CheckProcess scans the current process tree for a matching name
Types ¶
type ExemptionHandler ¶
type ExemptionHandler struct {
// Store the previous state: map[appName]wasExempt
PreviousStates map[string]bool
}
func (*ExemptionHandler) Apply ¶
func (h *ExemptionHandler) Apply(mm *memory.Manager, apps []interface{})
func (*ExemptionHandler) Cleanup ¶
func (h *ExemptionHandler) Cleanup(mm *memory.Manager)
type Manager ¶
type Manager struct {
Routines []*Routine
Ticker *time.Ticker
MemoryManager *memory.Manager
CapHandler *MemoryCapHandler // State restorer
}
func NewManager ¶
func (*Manager) Deactivate ¶
type MemoryCapHandler ¶
MemoryCapHandler manages the transition between global and routine-specific caps.
func (*MemoryCapHandler) ApplyCap ¶
func (h *MemoryCapHandler) ApplyCap(mm *memory.Manager, newValue interface{}) error
ApplyCap takes the value from the YAML (percentage) and updates the enforcer.
func (*MemoryCapHandler) Restore ¶
func (h *MemoryCapHandler) Restore(mm *memory.Manager)
Restore restores the preset cap and unlocks routine override
type Routine ¶
type Routine struct {
Name string `yaml:"name" json:"name"`
Enabled bool `yaml:"enabled" json:"enabled"`
Path string `yaml:"-" json:"-"`
Trigger Trigger `yaml:"trigger" json:"trigger"`
Actions []Action `yaml:"actions" json:"actions"`
StopCondition StopCondition `yaml:"stop_condition" json:"stop_condition"`
IsActive bool `yaml:"-" json:"isActive"` // camelCase for JS
}
func LoadRoutine ¶
LoadRoutine reads a YAML file and returns a Routine pointer
type StopCondition ¶
Click to show internal directories.
Click to hide internal directories.