Documentation
¶
Overview ¶
Package timex provides time functions via a struct.
This is intended to be paired with an interface for the used methods of the struct to be used in dependency injection. From there, a mock can be created for the interface, ensuring unit tests can use predictable times as needed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
type Clock struct{}
Clock provides a wrapper around functions in time to support dependency injection and mocking in unit tests.
func (*Clock) Now ¶
Now returns the current time in the local timezone.
This should only be used to calculate the durations between 2 points in time via the Since and Until methods.
Click to show internal directories.
Click to hide internal directories.