authelia/internal/utils/clock.go
Amir Zarrinkafsh e67f63ee44
[CI] Add godot linter (#958)
* [CI] Add godot linter

* Implement godot recommendations
2020-05-02 15:06:39 +10:00

23 lines
489 B
Go

package utils
import "time"
// Clock is an interface for a clock.
type Clock interface {
Now() time.Time
After(d time.Duration) <-chan time.Time
}
// RealClock is the implementation of a clock for production code.
type RealClock struct{}
// Now return the current time.
func (RealClock) Now() time.Time {
return time.Now()
}
// After return a channel receiving the time after the defined duration.
func (RealClock) After(d time.Duration) <-chan time.Time {
return time.After(d)
}