Documentation
¶
Overview ¶
Package clock is the one time source of the server. Every instant the server reasons about (expiry, leases, schedules, created_at) is read here and passed on, to the domain as an argument and to SQL as a query parameter; SQL never reads the database's clock. A test that moves the fake clock therefore moves everything at once.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fake ¶
type Fake struct {
// contains filtered or unexported fields
}
Fake is a clock that stands still until it is moved, for tests. Its timers fire when the clock is moved past them, so time-dependent behaviour is tested without sleeping.
Click to show internal directories.
Click to hide internal directories.