Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.
/ tardis Public archive

Time machine for your application to control time

License

Notifications You must be signed in to change notification settings

goph/tardis

Repository files navigation

Tardis

Build Status Go Report Card GolangCI GoDoc

Time machine for your application to control time.

Best practices

One should not create a hard dependency on this library in code. Instead custom, private interfaces should be created which is compatible with this library or can wrap it with a simple adapter.

For example:

package main

import(
	"time"
	
	"github.com/goph/tardis"
)

type myClock interface {
	Now() time.Time
}

type myService struct {
	clock myClock
}

func newMyService(clock myClock) *myService {
	return &myService{
		clock: clock,
	}
}

func main() {
	service := newMyService(tardis.SystemClock)
}

Development

Install the dependencies:

$ make vendor # or dep ensure

When all coding and testing is done, please run the test suite:

$ make check

License

The MIT License (MIT). Please see License File for more information.

About

Time machine for your application to control time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published