clock

package
v0.0.0-...-089553b Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0, Apache-2.0 Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock struct {
	Source Source
}

Clock provides access to the current time from an underlying source.

func (*Clock) Now

func (c *Clock) Now() time.Time

Now returns the current time as defined by the Clock's Source.

type RealSource

type RealSource struct{}

RealSource is a Source that uses the real time as provided by the stdlib time.Now() function as the current time.

func (RealSource) Now

func (RealSource) Now() time.Time

Now returns the real system time as reported by time.Now().

type Source

type Source interface {
	// Now returns the current time.
	Now() time.Time
}

Source is any type providing a Now function that returns the current time.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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