Add configuration and CLI foundation
This commit is contained in:
22
internal/timeutil/clock.go
Normal file
22
internal/timeutil/clock.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// Package timeutil provides time-zone, clock, and period helpers.
|
||||
package timeutil
|
||||
|
||||
import "time"
|
||||
|
||||
type Clock interface {
|
||||
Now() time.Time
|
||||
}
|
||||
|
||||
type SystemClock struct{}
|
||||
|
||||
func (SystemClock) Now() time.Time {
|
||||
return time.Now()
|
||||
}
|
||||
|
||||
type FixedClock struct {
|
||||
Time time.Time
|
||||
}
|
||||
|
||||
func (c FixedClock) Now() time.Time {
|
||||
return c.Time
|
||||
}
|
||||
Reference in New Issue
Block a user