Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
Clock defines how dig accesses time.
var System Clock = systemClock{}
System is the default implementation of Clock based on real time.
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock is a fake source of time. It implements standard time operations, but allows the user to control the passage of time.
Use the Mock.Add method to progress time.
Note that this implementation is not safe for concurrent use.
func NewMock ¶
func NewMock() *Mock
NewMock creates a new mock clock with the current time set to the current time.
Click to show internal directories.
Click to hide internal directories.