github.com/honsty/cron

a cron library for go


Install
go get github.com/honsty/cron

Documentation

GoDoc Build Status

cron

crontab for golang

usage

import (
    "fmt"
    "time"

    ncron "github.com/niean/cron"
)

func main() {
    // init cron
    c := ncron.New()

    // add cron job
    c.AddFunc("* * * * * *", func() { fmt.Println("Every second") })
    c.AddFuncCC("* * * * * *", func() { fmt.Println("Every second, with max Concurrrent 2"); time.Sleep(10 * time.Second)}, 2)

    // start cron
    c.Start()

    // keep alive
    select {}
}