mockclock

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mockclock provides clock.Clock implementation that uses GoMock mocking framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	clock.Scheduler
	clock.NowScheduler
	clock.TimerScheduler
	clock.TickerScheduler
	// contains filtered or unexported methods
}

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.

type MockClock

type MockClock struct {
	// contains filtered or unexported fields
}

MockClock is a mock of Clock interface.

func NewMockClock

func NewMockClock(ctrl *gomock.Controller) *MockClock

NewMockClock creates a new mock instance.

func (*MockClock) EXPECT

func (m *MockClock) EXPECT() *MockClockMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClock) Now

func (m *MockClock) Now() time.Time

Now mocks base method.

func (*MockClock) Schedule

func (m *MockClock) Schedule(d time.Duration, f func(time.Time)) clock.Event

Schedule mocks base method.

func (*MockClock) Ticker

func (m *MockClock) Ticker(d time.Duration) clock.Ticker

Ticker mocks base method.

func (*MockClock) Timer

func (m *MockClock) Timer(d time.Duration) clock.Timer

Timer mocks base method.

type MockClockMockRecorder

type MockClockMockRecorder struct {
	// contains filtered or unexported fields
}

MockClockMockRecorder is the mock recorder for MockClock.

func (*MockClockMockRecorder) Now

func (mr *MockClockMockRecorder) Now() *gomock.Call

Now indicates an expected call of Now.

func (*MockClockMockRecorder) Schedule

func (mr *MockClockMockRecorder) Schedule(d, f any) *gomock.Call

Schedule indicates an expected call of Schedule.

func (*MockClockMockRecorder) Ticker

func (mr *MockClockMockRecorder) Ticker(d any) *gomock.Call

Ticker indicates an expected call of Ticker.

func (*MockClockMockRecorder) Timer

func (mr *MockClockMockRecorder) Timer(d any) *gomock.Call

Timer indicates an expected call of Timer.

type MockTicker

type MockTicker struct {
	// contains filtered or unexported fields
}

MockTicker is a mock of Ticker interface.

func NewMockTicker

func NewMockTicker(ctrl *gomock.Controller) *MockTicker

NewMockTicker creates a new mock instance.

func (*MockTicker) C

func (m *MockTicker) C() <-chan time.Time

C mocks base method.

func (*MockTicker) EXPECT

func (m *MockTicker) EXPECT() *MockTickerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTicker) Reset

func (m *MockTicker) Reset(d time.Duration)

Reset mocks base method.

func (*MockTicker) Stop

func (m *MockTicker) Stop()

Stop mocks base method.

type MockTickerMockRecorder

type MockTickerMockRecorder struct {
	// contains filtered or unexported fields
}

MockTickerMockRecorder is the mock recorder for MockTicker.

func (*MockTickerMockRecorder) C

C indicates an expected call of C.

func (*MockTickerMockRecorder) Reset

func (mr *MockTickerMockRecorder) Reset(d any) *gomock.Call

Reset indicates an expected call of Reset.

func (*MockTickerMockRecorder) Stop

func (mr *MockTickerMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop.

type MockTimer

type MockTimer struct {
	// contains filtered or unexported fields
}

MockTimer is a mock of Timer interface.

func NewMockTimer

func NewMockTimer(ctrl *gomock.Controller) *MockTimer

NewMockTimer creates a new mock instance.

func (*MockTimer) C

func (m *MockTimer) C() <-chan time.Time

C mocks base method.

func (*MockTimer) EXPECT

func (m *MockTimer) EXPECT() *MockTimerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTimer) Reset

func (m *MockTimer) Reset(d time.Duration)

Reset mocks base method.

func (*MockTimer) Stop

func (m *MockTimer) Stop() bool

Stop mocks base method.

type MockTimerMockRecorder

type MockTimerMockRecorder struct {
	// contains filtered or unexported fields
}

MockTimerMockRecorder is the mock recorder for MockTimer.

func (*MockTimerMockRecorder) C

C indicates an expected call of C.

func (*MockTimerMockRecorder) Reset

func (mr *MockTimerMockRecorder) Reset(d any) *gomock.Call

Reset indicates an expected call of Reset.

func (*MockTimerMockRecorder) Stop

func (mr *MockTimerMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL