Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler is a struct that defines an instance of a scheduler. It holds the tasks (`[]*tasks`).
func New ¶
func New() *Scheduler
New returns a new empty scheduler. To this scheduler one would need to add tasks using `NewTask` and then start it using `Start`
s := scheduler.New() s.NewTask("* * * * *", func() { fmt.Println("Hello, world") }) s.Start()
func (*Scheduler) NewTask ¶
NewTask adds a new scheduler task. It receives a cron formatted string and a function of the type `TaskFunc` that's defined in this package.
Click to show internal directories.
Click to hide internal directories.