clocks

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock = clocks.Clock

Clock is generally only used for testing, but could be used for userspace clock-synchronization as well.

func DefaultClock

func DefaultClock() Clock

DefaultClock returns a clock that minimally wraps the `time` package

type FakeClock

type FakeClock = fake.Clock

FakeClock implements the Clock interface, with helpful primitives for testing and skipping through timestamps without having to actually sleep in the test. (wrapping github.com/vimeo/go-clocks/fake.Clock)

func NewFakeClock

func NewFakeClock(initialTime time.Time) *FakeClock

NewFakeClock returns an initialized FakeClock instance.

type OffsetClock

type OffsetClock = offset.Clock

OffsetClock wraps another clock, adjusting time intervals by a constant offset. (useful for simulating clock-skew) (forwarding alias for github.com/vimeo/go-clocks/offset.Clock

func NewOffsetClock

func NewOffsetClock(inner Clock, timeOffset time.Duration) *OffsetClock

NewOffsetClock creates an OffsetClock and returns it

Jump to

Keyboard shortcuts

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