Documentation ¶
Overview ¶
Package idleshut provides a lifecycle and idletime management tool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Start, if non-nil, is called by Process.Start. If an error is returned, // starting the process is aborted. Start func() error // Stop, if non-nil, is called by Process.Stop. If an error is returned, // stopping the process is aborted. Stop func() error // If TickDuration is non-zero, the process will count ticks where // the process is active or idle. Process are kept active by the user // calling the Process.Touch() method. When the process has been idle for // more than MaxIdleTicks, it will be stopped. If ticking is enabled, // TickError must be set or operations will result in a panic. TickDuration time.Duration TickError func(error) // Tick is called by Process for every iteration of Tick. If // an error is returned, it is sent to TickError. Additionally, // IdleTick and ActiveTick are called for idle and active ticks // respectively. Tick func() error IdleTick func() error ActiveTick func() error // MaxIdleTicks, if nonzero and ticking is configured, will cause // the process to stop once the maximum number of ticks has been // reached. MaxIdleTicks uint }
Config contains the options for creating a new process.
Click to show internal directories.
Click to hide internal directories.