To install the package, run:
go get github.com/go-zoox/cron
import (
"testing"
"github.com/go-zoox/cron"
)
func main(t *testing.T) {
c, err := cron.New()
if err != nil {
t.Fatal(err)
}
// c.AddJob("*/1 * * * *", func() {
// t.Log("cron job ran at", time.Now())
// })
c.AddSecondlyJob(func() {
t.Log("cron job ran at", time.Now())
})
c.Start()
for {
time.Sleep(time.Second)
}
}
- reugn/go-quartz - Minimalist and zero-dependency scheduling library for Go
- go-co-op/gocron - Easy and fluent Go cron scheduling
- robfig/cron - a cron library for go
GoZoox is released under the MIT License.