Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

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

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors