clock

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceClock = "service.clock"
)

Variables

This section is empty.

Functions

func ClockMustFromContainer

func ClockMustFromContainer(serviceContainer containercontract.Container) clockcontract.Clock

func ClockMustFromResolver

func ClockMustFromResolver(resolver containercontract.Resolver) clockcontract.Clock

Types

type FrozenClock

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

func NewFrozenClock

func NewFrozenClock(frozenTime time.Time) *FrozenClock

func (*FrozenClock) Advance

func (instance *FrozenClock) Advance(duration time.Duration)

func (*FrozenClock) NewTicker

func (instance *FrozenClock) NewTicker(interval time.Duration) clockcontract.Ticker

func (*FrozenClock) Now

func (instance *FrozenClock) Now() time.Time

func (*FrozenClock) TravelTo

func (instance *FrozenClock) TravelTo(targetTime time.Time)

type SystemClock

type SystemClock struct{}

func NewSystemClock

func NewSystemClock() *SystemClock

func (*SystemClock) NewTicker

func (instance *SystemClock) NewTicker(interval time.Duration) clockcontract.Ticker

func (*SystemClock) Now

func (instance *SystemClock) Now() time.Time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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