Versions in this module Expand all Collapse all v0 v0.2.0 Oct 6, 2026 Changes in this version type Watchdog + func (t *Watchdog) Close() + func (t *Watchdog) Start() v0.1.0 Sep 19, 2026 Changes in this version + type Error string + const ErrInvalidTimerSnapshot + func (e Error) Error() string + type Timer struct + func AfterFunc(duration time.Duration, f func()) *Timer + func FromJSON(data []byte) (*Timer, error) + func FromTime(startTime time.Time, duration time.Duration) *Timer + func NewTimer(duration time.Duration) *Timer + func RestoreTimer(snap *TimerSnapshot) (*Timer, error) + func (t *Timer) Duration() time.Duration + func (t *Timer) Elapsed() time.Duration + func (t *Timer) Expired() bool + func (t *Timer) Left() time.Duration + func (t *Timer) MarshalJSON() ([]byte, error) + func (t *Timer) Reset(duration time.Duration) + func (t *Timer) SetCallback(f func()) + func (t *Timer) Snapshot() *TimerSnapshot + func (t *Timer) StartTime() time.Time + func (t *Timer) State() TimerState + func (t *Timer) Stop() bool + func (t *Timer) StopTime() time.Time + func (t *Timer) ToJSON() ([]byte, error) + func (t *Timer) UnmarshalJSON(data []byte) error + func (t *Timer) UpdateState() + type TimerSnapshot struct + Duration time.Duration + StartTime time.Time + State TimerState + StopTime time.Time + func SnapshotTimer(t *Timer) *TimerSnapshot + func (s *TimerSnapshot) IsValid() bool + func (s *TimerSnapshot) Validate() error + type TimerState uint + const TimerStateExpired + const TimerStateInvalid + const TimerStateRunning + const TimerStateStopped + func TimerStateFromString(s string) TimerState + func (s *TimerState) UnmarshalText(data []byte) error + func (s TimerState) AppendText(b []byte) ([]byte, error) + func (s TimerState) IsValid() bool + func (s TimerState) MarshalText() ([]byte, error) + func (s TimerState) String() string + type Watchdog struct + func NewWatchdog(timeout time.Duration, callback func()) *Watchdog + func (t *Watchdog) Reset() + func (t *Watchdog) Stop()