package mockclock
Import Path
go.pact.im/x/clock/mockclock (on go.dev)
Dependency Relation
imports 4 packages, and imported by 0 packages
Involved Source Files
clock.go
Package mockclock provides clock.Clock implementation that uses GoMock
mocking framework.
gen.go
mockclock.go
ticker.go
timer.go
Package-Level Type Names (total 7, all are exported)
Clock is a union of all interfaces implemented by a full-featured clock
implementation. It is satisfied by clock.Clock that provides shims for
missing functionality.
It is an input for mock types generator and must not be used outside of this
package.
Now returns the current local time.
Schedule schedules an event that calls f in its own goroutine when
the given duration elapses. It returns an Event that can be canceled
using the Stop method.
Ticker returns a new Ticker containing a channel that will send the time
on the channel after each tick. The period of the ticks is specified by the
duration argument. The ticker will adjust the time interval or drop ticks to
make up for slow receivers. The duration d must be greater than zero; if
not, Ticker will panic. Stop the ticker to release associated resources.
Timer creates a new Timer that will send the current time on
its channel after at least duration d.
( Clock) private()
*MockClock
Clock : go.pact.im/x/clock.NowScheduler
Clock : go.pact.im/x/clock.Scheduler
Clock : go.pact.im/x/clock.TickerScheduler
Clock : go.pact.im/x/clock.TimerScheduler
MockClock is a mock of Clock interface.
ctrl *gomock.Controller
recorder *MockClockMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
Now mocks base method.
Schedule mocks base method.
Ticker mocks base method.
Timer mocks base method.
private mocks base method.
*MockClock : Clock
*MockClock : go.pact.im/x/clock.NowScheduler
*MockClock : go.pact.im/x/clock.Scheduler
*MockClock : go.pact.im/x/clock.TickerScheduler
*MockClock : go.pact.im/x/clock.TimerScheduler
func NewMockClock(ctrl *gomock.Controller) *MockClock
MockClockMockRecorder is the mock recorder for MockClock.
mock *MockClock
Now indicates an expected call of Now.
Schedule indicates an expected call of Schedule.
Ticker indicates an expected call of Ticker.
Timer indicates an expected call of Timer.
private indicates an expected call of private.
func (*MockClock).EXPECT() *MockClockMockRecorder
MockTicker is a mock of Ticker interface.
ctrl *gomock.Controller
recorder *MockTickerMockRecorder
C mocks base method.
EXPECT returns an object that allows the caller to indicate expected use.
Reset mocks base method.
Stop mocks base method.
*MockTicker : go.pact.im/x/clock.Ticker
func NewMockTicker(ctrl *gomock.Controller) *MockTicker
MockTickerMockRecorder is the mock recorder for MockTicker.
mock *MockTicker
C indicates an expected call of C.
Reset indicates an expected call of Reset.
Stop indicates an expected call of Stop.
func (*MockTicker).EXPECT() *MockTickerMockRecorder
MockTimer is a mock of Timer interface.
ctrl *gomock.Controller
recorder *MockTimerMockRecorder
C mocks base method.
EXPECT returns an object that allows the caller to indicate expected use.
Reset mocks base method.
Stop mocks base method.
*MockTimer : go.pact.im/x/clock.Timer
func NewMockTimer(ctrl *gomock.Controller) *MockTimer
Package-Level Functions (total 3, all are exported)
NewMockClock creates a new mock instance.
NewMockTicker creates a new mock instance.
NewMockTimer creates a new mock instance.
The pages are generated with Golds v0.4.9. (GOOS=linux GOARCH=amd64)