clock

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultClock

type DefaultClock struct{}

func New

func New() *DefaultClock

New returns a new clock that runs on system time.

func (*DefaultClock) Now

func (*DefaultClock) Now() time.Time

type StaticClock

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

func Static

func Static(time time.Time) *StaticClock

Static returns a new clock that always returns the given static value.

func (*StaticClock) Now

func (c *StaticClock) Now() time.Time

type ZeroClock added in v1.1.0

type ZeroClock struct{}

func Zero added in v1.1.0

func Zero() *ZeroClock

func (*ZeroClock) Now added in v1.1.0

func (c *ZeroClock) Now() time.Time

Jump to

Keyboard shortcuts

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