Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Clock ¶
Clock is a small interface abstracting time operations the package needs. Use this to inject testable/fake clocks in unit tests rather than relying on time.Now directly.
func ClockFromContext ¶
type TestClock ¶
type TestClock struct {
// contains filtered or unexported fields
}
TestClock is a simple, mutex-protected, manually-advancable clock useful for tests. It allows deterministic control of Now() by setting an initial time and advancing it as needed.
func NewTestClock ¶
NewTestClock constructs a TestClock seeded to the provided time.
Click to show internal directories.
Click to hide internal directories.