clock

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package clock provides an injectable time source so tests never sleep.

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
}

func Real

func Real() Clock

Real returns the system clock.

type Fake

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

Fake is a manually advanced clock for tests.

func NewFake

func NewFake(t time.Time) *Fake

func (*Fake) Advance

func (f *Fake) Advance(d time.Duration)

func (*Fake) Now

func (f *Fake) Now() time.Time

Jump to

Keyboard shortcuts

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