mocktime

package
v0.0.1-77 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chrono

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

Chrono represents special time handling, allowing the acceleration or alteration of time.

func (*Chrono) After

func (t *Chrono) After(d time.Duration) <-chan time.Time

After returns a channel which signals when the duration has passed.

func (*Chrono) AfterFunc

func (t *Chrono) AfterFunc(d time.Duration, f func())

AfterFunc calls a callback function after a duration has passed.

func (*Chrono) Now

func (t *Chrono) Now() time.Time

Now returns the current timestamp from the mock time.

func (*Chrono) TimeShift

func (t *Chrono) TimeShift() time.Duration

TimeShift returns the current time shift from the mock time.

func (*Chrono) TimeTravel

func (t *Chrono) TimeTravel(d time.Duration)

TimeTravel adjusts the current time by a set amount

Jump to

Keyboard shortcuts

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