mirror of https://github.com/dapr/kit.git
1. Removed `github.com/pkg/errors` and replaced with the standard library (linter now rejects the old package) 2. Cron test: fixed race conditions and linting 3. Renamed `logger/default.go` to `logger/nop_logger.go` to match the name of the struct inside Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com> |
||
---|---|---|
.. | ||
.gitignore | ||
.travis.yml | ||
LICENSE | ||
README.md | ||
chain.go | ||
chain_test.go | ||
constantdelay.go | ||
constantdelay_test.go | ||
cron.go | ||
cron_test.go | ||
doc.go | ||
logger.go | ||
option.go | ||
option_test.go | ||
parser.go | ||
parser_test.go | ||
spec.go | ||
spec_test.go |
README.md
Cron
This package is a fork of github.com/robfig/cron/v3@v3.0.0
which adds support for mocking the time using github.com/benbjohnson/clock
See LICENSE for the license of the original package.
Using Cron with Mock Clock
import "github.com/benbjohnson/clock"
clk := clock.NewMock()
c := cron.New(cron.WithClock(clk))
c.AddFunc("@every 1h", func() {
fmt.Println("Every hour")
})
c.Start()
clk.Add(1 * time.Hour)