[#3132] updated godoc

This commit is contained in:
Gani Georgiev 2023-08-15 12:25:24 +03:00
parent 5f21c4119f
commit 67fa47b1bb
1 changed files with 9 additions and 3 deletions

View File

@ -74,15 +74,21 @@ var macros = map[string]string{
// NewSchedule creates a new Schedule from a cron expression. // NewSchedule creates a new Schedule from a cron expression.
// //
// A cron expression is consisted of 5 segments separated by space, // A cron expression could be a macro OR 5 segments separated by space,
// representing: minute, hour, day of the month, month and day of the week. // representing: minute, hour, day of the month, month and day of the week.
// //
// Each segment could be in the following formats: // The following segment formats are supported:
// - wildcard: * // - wildcard: *
// - range: 1-30 // - range: 1-30
// - step: */n or 1-30/n // - step: */n or 1-30/n
// - list: 1,2,3,10-20/n // - list: 1,2,3,10-20/n
// - macros: @yearly (or @annually), @monthly, @weekly, @daily (or @midnight), @hourly //
// The following macros are supported:
// - @yearly (or @annually)
// - @monthly
// - @weekly
// - @daily (or @midnight)
// - @hourly
func NewSchedule(cronExpr string) (*Schedule, error) { func NewSchedule(cronExpr string) (*Schedule, error) {
if v, ok := macros[cronExpr]; ok { if v, ok := macros[cronExpr]; ok {
cronExpr = v cronExpr = v