Documentation
¶
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
After(d time.Duration) <-chan time.Time
Since(t time.Time) time.Duration
}
Clock abstracts time measurement to allow for deterministic testing.
type MockClock ¶
MockClock is a controllable clock for testing. All accessors are guarded by a mutex so Advance and the read methods are safe to call from concurrent goroutines (e.g. a goroutine advancing time while another reads Now under the race detector).
Click to show internal directories.
Click to hide internal directories.