2020-10-02 09:56:48 +00:00
|
|
|
//go:generate mockgen -source=$GOFILE -destination=./../../internal/mock/cert/time_source.mock.go -package=cert_mock
|
2020-04-25 22:22:45 +00:00
|
|
|
|
|
|
|
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()
|
|
|
|
}
|