AddFunc adds a func to the Cron to be run on the given schedule. The spec is parsed using the time zone of this Cron instance as the default. An opaque ID is returned that can be used to later remove it.
(spec string, cmd func())
| 139 | // The spec is parsed using the time zone of this Cron instance as the default. |
| 140 | // An opaque ID is returned that can be used to later remove it. |
| 141 | func (c *Cron) AddFunc(spec string, cmd func()) (EntryID, error) { |
| 142 | return c.AddJob(spec, FuncJob(cmd)) |
| 143 | } |
| 144 | |
| 145 | // AddJob adds a Job to the Cron to be run on the given schedule. |
| 146 | // The spec is parsed using the time zone of this Cron instance as the default. |