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)
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/benbjohnson/clock.Clock (interface)
*github.com/benbjohnson/clock.Mock
github.com/libp2p/go-libp2p/p2p/host/autorelay.ClockWithInstantTimer (interface)
github.com/libp2p/go-libp2p/p2p/host/autorelay.RealClock
github.com/libp2p/go-libp2p/p2p/net/swarm.Clock (interface)
github.com/libp2p/go-libp2p/p2p/net/swarm.RealClock
github.com/pion/stun.Clock (interface)
github.com/pion/stun/v3.Clock (interface)
github.com/quic-go/quic-go/internal/congestion.Clock (interface)
github.com/quic-go/quic-go/internal/congestion.DefaultClock
go.uber.org/dig/internal/digclock.Clock (interface)
*go.uber.org/dig/internal/digclock.Mock
go.uber.org/fx/internal/fxclock.Clock (interface)
*go.uber.org/fx/internal/fxclock.Mock
go.uber.org/zap/zapcore.Clock (interface)
Clock : github.com/pion/stun.Clock
Clock : github.com/pion/stun/v3.Clock
Clock : github.com/quic-go/quic-go/internal/congestion.Clock
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/pion/stun.Clock
*SimulatedClock : github.com/pion/stun/v3.Clock
*SimulatedClock : github.com/quic-go/quic-go/internal/congestion.Clock
func NewSimulatedClock(t time.Time) *SimulatedClock
Package-Level Functions (total 2)
func NewRealClock() Clock func NewSimulatedClock(t time.Time) *SimulatedClock![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |