timeutils

package
v2.20.0-dev.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TimeAnchor

func TimeAnchor() time.Time

TimeAnchor gives you back a timestamp of the first caller that ever called this function

Types

type TimelineProvider

type TimelineProvider interface {

	// Now Returns the current (client-side) time in UTC
	Now() time.Time

	// Sleep suspends the current goroutine for the specified duration
	Sleep(duration time.Duration)
}

TimelineProvider abstracts away the time.Now() and time.Sleep(time.Duration) functions to make code unit-testable Whenever you need to get the current time, or want to pause the current goroutine (sleep), please consider using this interface

func NewTimelineProvider

func NewTimelineProvider() TimelineProvider

NewTimelineProvider creates a new TimelineProvider

Jump to

Keyboard shortcuts

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