clock

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package clock provides the Clock contract to provide time with testability.

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock defines an interface for getting the current time, allowing for easier testing and time manipulation.

type Fixed

type Fixed struct{ T time.Time }

func NewFixed

func NewFixed(t time.Time) *Fixed

func (*Fixed) Now

func (f *Fixed) Now() time.Time

type System

type System struct{}

func NewSystem

func NewSystem() *System

func (*System) Now

func (s *System) Now() time.Time

Jump to

Keyboard shortcuts

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