Documentation ¶
Overview ¶
clock is a package for providing time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EvenlySpaced ¶
EvenlySpaced is a clock providing evenly-spaced times with every call to Now: T, T+Delta, T + 2*Delta, ...
&EvenlySpaced{Delta: ...} is ready to use, although starts at 0001-01-01 0:00:00 (the ero value of time.Time).
func (*EvenlySpaced) Now ¶
func (es *EvenlySpaced) Now() time.Time
type Interface ¶
Interface defines a clock, which can provide time.
var System Interface = systemClock{}
System is a clock which uses time.Now() to provide time.
type Specific ¶
type Specific struct { // Times is the slice of times to generate. Times []time.Time // WrapAround controls the behavior once the Specific clock runs out of times. // If false (default), Now() panics. Otherwise, Now() wraps around and starts // back at the beginning of the provided slice. WrapAround bool // contains filtered or unexported fields }
Specific is a clock providing specific times, in sequence.
&Specific{Time: ...} is ready to use.
Click to show internal directories.
Click to hide internal directories.