package digclock
Import Path
go.uber.org/dig/internal/digclock (on go.dev)
Dependency Relation
imports one package, and imported by one package
Involved Source Files
clock.go
Package-Level Type Names (total 2)
Clock defines how dig accesses time.
( Clock) Now() time.Time
( Clock) Since(time.Time) time.Duration
*Mock
go.uber.org/fx/internal/fxclock.Clock (interface)
*go.uber.org/fx/internal/fxclock.Mock
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
Clock : github.com/hibiken/asynq/internal/timeutil.Clock
Clock : github.com/pion/stun.Clock
Clock : github.com/pion/stun/v3.Clock
Clock : github.com/quic-go/quic-go/internal/congestion.Clock
var System
Mock is a fake source of time.
It implements standard time operations, but allows
the user to control the passage of time.
Use the [Mock.Add] method to progress time.
Note that this implementation is not safe for concurrent use.
Add progresses time by the given duration.
It panics if the duration is negative.
Now returns the current time.
Since returns the time elapsed since the given time.
*Mock : Clock
*Mock : github.com/hibiken/asynq/internal/timeutil.Clock
*Mock : github.com/pion/stun.Clock
*Mock : github.com/pion/stun/v3.Clock
*Mock : github.com/quic-go/quic-go/internal/congestion.Clock
func NewMock() *Mock
Package-Level Functions (only one)
NewMock creates a new mock clock with the current time set to the current time.
Package-Level Variables (only one)
System is the default implementation of Clock based on real time.
![]() |
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. |