clock

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = defaultClock{}

Default clock. Uses time.Now() internally.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock represents a time source It can be used as a way to abstract away the implicit dependency on time.Now() from code.

type Mock

type Mock struct {
	mock.Mock
}

Mock clock for testing

func (*Mock) Now

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

Jump to

Keyboard shortcuts

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