clock

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 1 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 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