1package db 2 3import "time" 4 5//go:generate counterfeiter . Clock 6 7type Clock interface { 8 Now() time.Time 9 Until(time.Time) time.Duration 10} 11 12type clock struct{} 13 14func NewClock() clock { 15 return clock{} 16} 17 18func (c *clock) Now() time.Time { 19 return time.Now() 20} 21 22func (c *clock) Until(t time.Time) time.Duration { 23 return time.Until(t) 24} 25