clock

package
v0.0.0-...-a26ebea Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: AGPL-3.0 Imports: 1 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 returns the current time for the clock.
	Now() time.Time
}

Clock represents an interface around time management.

Normally, one would just use the `time` package and be done with it. However, that makes it quite difficult to properly test functions are grabbing time values using the wallclock. The goal of this interface is to allow time-dependent code to abstract the underlying clock away so we can freeze/modify it during testing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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