package timeutil

Import Path
	github.com/hibiken/asynq/internal/timeutil (on go.dev)

Dependency Relation
	imports 2 packages, and imported by 3 packages

Involved Source Files Package timeutil exports functions and types related to time and date.
Package-Level Type Names (total 2)
/* sort by: | */
A Clock is an object that can tell you the current time. This interface allows decoupling code that uses time from the code that creates a point in time. You can use this to your advantage by injecting Clocks into interfaces rather than having implementations call time.Now() directly. Use RealClock() in production. Use SimulatedClock() in test. ( Clock) Now() time.Time *SimulatedClock github.com/failsafe-go/failsafe-go/internal/util.BucketedWindow[...] github.com/failsafe-go/failsafe-go/internal/util.Clock[priority.usageStat] (interface) Clock : github.com/failsafe-go/failsafe-go/internal/util.Clock[priority.usageStat] func NewRealClock() Clock func github.com/hibiken/asynq/internal/rdb.(*RDB).SetClock(c Clock)
A SimulatedClock is a concrete Clock implementation that doesn't "tick" on its own. Time is advanced by explicit call to the AdvanceTime() or SetTime() functions. This object is concurrency safe. (*SimulatedClock) AdvanceTime(d time.Duration) (*SimulatedClock) Now() time.Time (*SimulatedClock) SetTime(t time.Time) *SimulatedClock : Clock *SimulatedClock : github.com/failsafe-go/failsafe-go/internal/util.Clock[priority.usageStat] func NewSimulatedClock(t time.Time) *SimulatedClock
Package-Level Functions (total 2)