Documentation ¶
Overview ¶
Package faketime provides a fake clock that implements tcpip.Clock interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManualClock ¶
type ManualClock struct {
// contains filtered or unexported fields
}
ManualClock implements tcpip.Clock and only advances manually with Advance method.
func NewManualClock ¶
func NewManualClock() *ManualClock
NewManualClock creates a new ManualClock instance.
func (*ManualClock) Advance ¶
func (mc *ManualClock) Advance(d time.Duration)
Advance executes all work that have been scheduled to execute within d from the current time. Blocks until all work has completed execution.
func (*ManualClock) AfterFunc ¶
func (mc *ManualClock) AfterFunc(d time.Duration, f func()) tcpip.Timer
AfterFunc implements tcpip.Clock.AfterFunc.
func (*ManualClock) NowMonotonic ¶
func (mc *ManualClock) NowMonotonic() tcpip.MonotonicTime
NowMonotonic implements tcpip.Clock.NowMonotonic.
func (*ManualClock) RunImmediatelyScheduledJobs ¶
func (mc *ManualClock) RunImmediatelyScheduledJobs()
RunImmediatelyScheduledJobs runs all jobs scheduled to run at the current time.
type NullClock ¶
type NullClock struct{}
NullClock implements a clock that never advances.
func (*NullClock) NowMonotonic ¶
func (*NullClock) NowMonotonic() tcpip.MonotonicTime
NowMonotonic implements tcpip.Clock.NowMonotonic.
Click to show internal directories.
Click to hide internal directories.