goCron: A Golang Job Scheduling Package.

goCron is a Golang job scheduling package which lets you run Go functions periodically at pre-determined interval using a simple, human-friendly syntax.
goCron is a Golang implementation of Ruby module clockwork and Python job scheduling package schedule, and personally, this package is my first Golang program, just for fun and practice.
See also this two great articles:
Back to this package, you could just use this simple API as below, to run a cron scheduler.
package main
import (
"fmt"
"github.com/jasonlvhit/gocron"
)
func task() {
fmt.Println("I am runnning task.")
}
func taskWithParams(a int, b string) {
fmt.Println(a, b)
}
func main() {
gocron.Every(1).Second().Do(taskWithParams, 1, "hello")
gocron.Every(1).Second().Do(task)
gocron.Every(2).Seconds().Do(task)
gocron.Every(1).Minute().Do(task)
gocron.Every(2).Minutes().Do(task)
gocron.Every(1).Hour().Do(task)
gocron.Every(2).Hours().Do(task)
gocron.Every(1).Day().Do(task)
gocron.Every(2).Days().Do(task)
gocron.Every(1).Monday().Do(task)
gocron.Every(1).Thursday().Do(task)
gocron.Every(1).Day().At("10:30").Do(task)
gocron.Every(1).Monday().At("18:30").Do(task)
_, time := gocron.NextRun()
fmt.Println(time)
gocron.Remove(task)
gocron.Clear()
<- gocron.Start()
s := gocron.NewScheduler()
s.Every(3).Seconds().Do(task)
<- s.Start()
}
and full test cases and document will be coming soon.
Once again, thanks to the great works of Ruby clockwork and Python schedule package. BSD license is used, see the file License for detail.
Hava fun!