Documentation ¶
Index ¶
- type Clock
- type Mock
- func (m *Mock) After(d time.Duration) <-chan time.Time
- func (m *Mock) Sleep(d time.Duration)
- func (m *Mock) Ticker(d time.Duration) *clock.Ticker
- func (m *Mock) Timer(d time.Duration) *clock.Timer
- func (m *Mock) TimerCh() <-chan time.Duration
- func (m *Mock) WaitForAfter(timeout time.Duration, format string, args ...interface{})
- func (m *Mock) WaitForSleep(timeout time.Duration, format string, args ...interface{})
- func (m *Mock) WaitForTicker(timeout time.Duration, format string, args ...interface{})
- func (m *Mock) WaitForTickerMulti(timeout time.Duration, count int, format string, args ...interface{})
- func (m *Mock) WaitForTimer(timeout time.Duration, format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
Mock is a mock clock that can be precisely controlled
func (*Mock) After ¶
After waits for the duration to elapse and then sends the current time on the returned channel.
func (*Mock) Ticker ¶
Ticker returns a new Ticker containing a channel that will send the time with a period specified by the duration argument.
func (*Mock) Timer ¶
Timer creates a new Timer containing a channel that will send the time with a period specified by the duration argument.
func (*Mock) WaitForAfter ¶
WaitForAfter waits up to the specified timeout for After to be called on the clock.
func (*Mock) WaitForSleep ¶
WaitForSleep waits up to the specified timeout for a sleep to begin using the clock.
func (*Mock) WaitForTicker ¶
WaitForTicker waits up to the specified timeout for a Ticker to be created from the clock.