clock

package
v0.0.0-...-f9f6af2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.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