systemclock

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package systemclock implements the ports.Clock interface using the real system clock. The sole responsibility of this adapter is to call time.Now() and normalize the result to UTC — all other time arithmetic happens in the domain or application layer.

Application and domain code MUST NOT call time.Now() directly; all current-time access is routed through the Clock port so that tests can substitute a deterministic FakeClock.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock struct{}

Clock is the live implementation of ports.Clock. The zero value is ready to use; prefer New() for clarity.

func New

func New() *Clock

New returns a Clock backed by the system clock.

func (Clock) Now

func (Clock) Now() time.Time

Now returns the current time in UTC. Successive calls are non-decreasing because time.Now() is backed by a monotonic clock source on all platforms supported by this binary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL