// Package clock provides an injectable time source. Production code uses Real();
// tests use NewFake(t) to make time-based logic deterministic.
package clock

import "time"

// Clock is the abstraction over the system clock. Implementations must be
// safe for concurrent use.
type Clock interface {
	Now() time.Time
}

type realClock struct{}

// Real returns a Clock backed by time.Now.
func Real() Clock { return realClock{} }

func (realClock) Now() time.Time { return time.Now() }
