Files
sendico/api/pkg/clock/clock.go
Stephan D 62a6631b9a
All checks were successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
service backend
2025-11-07 18:35:26 +01:00

22 lines
415 B
Go

package clock
import "time"
// Clock exposes basic time operations, primarily for test overrides.
type Clock interface {
Now() time.Time
}
// System implements Clock using the system wall clock.
type System struct{}
// Now returns the current UTC time.
func (System) Now() time.Time {
return time.Now().UTC()
}
// NewSystem returns a system-backed clock instance.
func NewSystem() Clock {
return System{}
}