package
Version:
v0.0.0-...-d13d30b
Opens a new window with list of versions in this module.
Published: Mar 10, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package clock provides a testable clock interface for TTL calculations.
type Clock interface {
Now() time.Time
}
Clock is an interface for getting the current time.
Mock is a controllable clock for tests.
NewMock creates a Mock clock set to the given time.
Advance moves the clock forward by the given duration.
Now returns the mock clock's current time.
Set sets the mock clock to an absolute time.
Real is the production clock -- uses system time.
Now returns the current system time.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.