baez90
57a7e10e74
* Add Prometheus metrics - cleanup - update dependencies - improve parsing of options where possible - Update Go to latest version
20 lines
374 B
Go
20 lines
374 B
Go
//go:generate mockgen -source=$GOFILE -destination=./../../internal/mock/cert/time_source.mock.go -package=cert_mock
|
|
|
|
package cert
|
|
|
|
import "time"
|
|
|
|
type TimeSource interface {
|
|
UTCNow() time.Time
|
|
}
|
|
|
|
func NewTimeSource() TimeSource {
|
|
return &defaultTimeSource{}
|
|
}
|
|
|
|
type defaultTimeSource struct {
|
|
}
|
|
|
|
func (d defaultTimeSource) UTCNow() time.Time {
|
|
return time.Now().UTC()
|
|
}
|