go-agenda is a Go library that allows you to schedule jobs and persist them in a SQL database. It is inspired by the Agenda Node.js library.
- Schedules job using a cron expression
- Stores the job metadata such as next run time, last run time and any errors produced in the SQL database
db, _ := sql.Open("mysql", "user:test@/goagenda")
agenda, _ := agenda.New(db)
agenda.Define("print hello", func() error {
fmt.Println("Hello world")
return nil
})
// Will run the job at the beginning of every minute
agenda.RepeatEvery("print hello", "* * * * *")
agenda.Start()
See cmd/main.go for a working example.