Discover Packages
github.com/floriscornel/teams-cli
internal
clock
package
Version:
v1.1.1
Opens a new window with list of versions in this module.
Published: Oct 14, 2026
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package clock injects time into the CLI so that relative output, `--since`
windows, token-expiry checks and retention pruning are deterministic in tests
(PLAN.md, Layer 1: "an injected clock keeps relative times and --since
deterministic").
type Clock interface {
Now() time .Time
}
Clock is the seam every package takes instead of calling time.Now directly.
New returns the real clock.
Fake is a manually advanced clock for tests.
NewFake returns a clock frozen at t (UTC).
Advance moves the clock forward by d.
Now returns the frozen time.
Set moves the clock to t.
System is the real clock.
Now returns the current local time.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.