Documentation ¶
Index ¶
- Constants
- func CreateDir(path string) error
- func DeleteDir(path string) error
- func HomeDir() string
- func NewFile(fileName string) (*os.File, error)
- func PathExists(path string) (bool, error)
- func SecondsToHuman(input int) (result string)
- func TimeToStandardDateTimeFormat(time time.Time) string
- func WriteToFile(fileName string, bytes []byte) error
- type Clock
- type LiveClock
- type MockedClock
- type NotFoundError
- type ReportNotImplementedError
Constants ¶
const DateFormat = "2006-01-02"
DateFormat is the standard date format used throughout the code.
Variables ¶
This section is empty.
Functions ¶
func PathExists ¶
PathExists returns true whether the path exists or not in the file system
func SecondsToHuman ¶
SecondsToHuman returns a human description of a duration in seconds Taken from: https://www.socketloop.com/tutorials/golang-convert-seconds-to-human-readable-time-format-example
func WriteToFile ¶
WriteToFile writes bytes to a file.
Types ¶
type LiveClock ¶
type LiveClock struct{}
LiveClock represents a "correct" clock (time has not been tempered with)
type MockedClock ¶
MockedClock represents a clock where the current time is changed
func NewMockedClock ¶
func NewMockedClock(now time.Time) *MockedClock
NewMockedClock returns a new mocked clock
func (*MockedClock) Now ¶
func (clock *MockedClock) Now() time.Time
Now returns the current time in the mocked clock
type NotFoundError ¶
type NotFoundError struct {
Err string
}
NotFoundError represents the specific error NotFound (useful when something cannot be found, like an activity)
func NewNotFoundError ¶
func NewNotFoundError(err string) *NotFoundError
NewNotFoundError creates a new not found error
func (*NotFoundError) Error ¶
func (err *NotFoundError) Error() string
Error implements the Error method from the error interface
type ReportNotImplementedError ¶
type ReportNotImplementedError struct {
Err string
}
func NewReportNotImplementedError ¶
func NewReportNotImplementedError() *ReportNotImplementedError
NewReportNotImplementedError creates a new not found error
func (*ReportNotImplementedError) Error ¶
func (err *ReportNotImplementedError) Error() string