Documentation
¶
Index ¶
- type Clock
- type MockClock
- func (c *MockClock) Add(d time.Duration)
- func (c *MockClock) After(d time.Duration) <-chan time.Time
- func (c *MockClock) AfterFunc(d time.Duration, f func()) *Timer
- func (c *MockClock) NewTicker(d time.Duration) *Ticker
- func (c *MockClock) NewTimer(d time.Duration) *Timer
- func (c *MockClock) Now() time.Time
- func (c *MockClock) Sleep(d time.Duration)
- type RealClock
- func (c *RealClock) After(d time.Duration) <-chan time.Time
- func (c *RealClock) AfterFunc(d time.Duration, f func()) *Timer
- func (c *RealClock) NewTicker(d time.Duration) *Ticker
- func (c *RealClock) NewTimer(d time.Duration) *Timer
- func (c *RealClock) Now() time.Time
- func (c *RealClock) Sleep(d time.Duration)
- type Ticker
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
type Clock interface {
Now() time.Time
After(time.Duration) <-chan time.Time
AfterFunc(time.Duration, func()) *Timer
Sleep(time.Duration)
NewTicker(time.Duration) *Ticker
NewTimer(time.Duration) *Timer
}
Clock provides time controls for production and tests.
type MockClock ¶
type MockClock struct {
// contains filtered or unexported fields
}
MockClock is a controllable clock for tests.
type RealClock ¶
type RealClock struct {
// contains filtered or unexported fields
}
RealClock uses the system clock.
type Ticker ¶
Ticker wraps a clock ticker with a channel and controls.
Click to show internal directories.
Click to hide internal directories.