The robfig/cron Library
Schedule with cron syntax.
Cron Expressions in Go
The robfig/cron library lets you schedule jobs with familiar cron syntax instead of hand-written time math. Install with go get github.com/robfig/cron/v3.
import "github.com/robfig/cron/v3"Cron Syntax Refresher
A standard cron expression has five fields:
- minute (0-59)
- hour (0-23)
- day of month (1-31)
- month (1-12)
- day of week (0-6)
Example: 0 9 * * 1-5 = 9:00 AM on weekdays.
All lessons in this course
- Time-Based Scheduling
- The robfig/cron Library
- Tickers for Intervals
- Graceful Job Shutdown