clock

package
v0.27.0-rc.13 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 1 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Now

func Now() time.Time

Now returns the current time from the package's backend. Use it rather than time.Now everywhere but a deadline or an elapsed-time measurement, so a test can control what "now" means.

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock is an interface that can provide time related functionality which allows us to test time dependent code.

var DefaultBackend Clock

DefaultBackend is used to configure the defaultBackend.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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