21 lines
532 B
Go
21 lines
532 B
Go
// Package clock provides the gateway time source abstraction used by
|
|
// authenticated transport checks.
|
|
package clock
|
|
|
|
import "time"
|
|
|
|
// Clock returns current server time for freshness checks and time-dependent
|
|
// transport behavior.
|
|
type Clock interface {
|
|
// Now returns the current server time.
|
|
Now() time.Time
|
|
}
|
|
|
|
// System returns the current process time using the local system clock.
|
|
type System struct{}
|
|
|
|
// Now returns the current UTC time from the system clock.
|
|
func (System) Now() time.Time {
|
|
return time.Now().UTC()
|
|
}
|