clock

package
v0.0.0-...-e2712e4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FAKE_CLOCK_INITIAL_DATE = time.Date(1984, time.April, 4, 0, 0, 0, 0, time.UTC)

Functions

func DefaultClock

func DefaultClock() clockwork.Clock

func NewFakeClock

func NewFakeClock() *clockwork.FakeClock

func NewFakeClockAt

func NewFakeClockAt(time time.Time) *clockwork.FakeClock

func NewRealClock

func NewRealClock() clockwork.Clock

func SetDefaultClock

func SetDefaultClock(clock clockwork.Clock)

Types

type Clock

type Clock interface {
	After(d time.Duration) <-chan time.Time
	Sleep(d time.Duration)
	Now() time.Time
	Since(t time.Time) time.Duration
}

type ClockConsumer

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

func (*ClockConsumer) Clock

func (consumer *ClockConsumer) Clock() clockwork.Clock

func (*ClockConsumer) SetClock

func (consumer *ClockConsumer) SetClock(clock clockwork.Clock)

type ClockInterface

type ClockInterface interface {
	SetClock(clockwork.Clock)
	Clock() clockwork.Clock
}

type FakeClock

type FakeClock interface {
	Clock

	Advance(d time.Duration)
	BlockUntil(n int)
}

Jump to

Keyboard shortcuts

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