Skip to content
/ clocks Public

An abstraction layer for all the time-passage-dependent features from the standard Go time package.

License

Notifications You must be signed in to change notification settings

agext/clocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Go package enabling time travel (sort of)

Release GoDoc  Build Status Coverage Status Go Report Card

This package provides an abstraction layer for all the time-passage-dependent features from the standard Go time package. This allows code to be written once and run on different clocks, e.g. for testing or for "replay" applications.

Project Status

v0.1 Edge: Breaking changes to the API unlikely but possible until the v1.0 release. May be robust enough to use in production, though provided on "AS IS" basis. Vendoring recommended.

This package is under active development. If you encounter any problems or have any suggestions for improvement, please open an issue. Pull requests are welcome.

Overview

The Clock interface groups all the time-passage-dependent features from the standard time package. A Timer and a Ticker interface are included to allow abstraction of these concepts.

A "live" Clock is provided in this package giving pass-through access to the standard functionality.

A "manual" Clock is included as a separate package, because it is mostly useful for testing and it is rarely if ever needed in the actual program.

Installation

go get github.com/agext/clocks

License

Package clocks is released under the Apache 2.0 license. See the LICENSE file for details.

About

An abstraction layer for all the time-passage-dependent features from the standard Go time package.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages