Documentation
¶
Overview ¶
Package clock abstracts time so the daemon's timers (idle detection, settling, credential rotation) can be driven by a fake clock in tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
type Clock interface {
Now() time.Time
// Since is Now().Sub(t), using the monotonic reading when t carries one.
Since(t time.Time) time.Duration
// NewTicker returns a ticker whose channel fires every d.
NewTicker(d time.Duration) Ticker
// After fires once after d.
After(d time.Duration) <-chan time.Time
}
Clock is the subset of the time package the daemon uses.
type Fake ¶
type Fake struct {
// contains filtered or unexported fields
}
Fake is a manually advanced clock. Tickers and timers fire synchronously from Advance.
Click to show internal directories.
Click to hide internal directories.