api/pkg/cert/time_source.go
Peter Kurfer 7c2a41ad25 Move TLS/cert handling to main app
- apply changes in proxy plugin and TLS interceptor
- add HTTPS proxy support
- move ca-generation command to main app
- minor refactoring to improve API stability
- move mocks to extra packages to avoid cycling imports
- fix bug in multi-port configuration
- change HTTP proxy to redirect to HTTP mock instead of maintaining custom rules
2020-04-26 00:32:46 +02:00

20 lines
381 B
Go

//go:generate mockgen -source=time_source.go -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()
}