Skip to content

go-zoox/cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cron - Make Job Scheduling Easier

PkgGoDev Build Status Go Report Card Coverage Status GitHub issues Release

Installation

To install the package, run:

go get github.com/go-zoox/cron

Getting Started

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)
	}
}

Inspired by

License

GoZoox is released under the MIT License.