clock

package
v0.0.0-...-f261bde Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock is used to give time.

type Default

type Default struct{}

Default is a Clock implementation base ton time.Now()

func NewDefault

func NewDefault() *Default

NewDefault create a new Clock.

func (*Default) Now

func (t *Default) Now() time.Time

Now return the time for the exact moment.

type MockClock

type MockClock struct {
	mock.Mock
}

MockClock is an autogenerated mock type for the Clock type

func NewMockClock

func NewMockClock(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockClock

NewMockClock creates a new instance of MockClock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockClock) Now

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

Now provides a mock function with given fields:

type Stub

type Stub struct {
	Time time.Time
}

Stub is a stub implementation of Clock

func (*Stub) Now

func (t *Stub) Now() time.Time

Now stub method.

Jump to

Keyboard shortcuts

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