validateDailySpec ensures that the day-of-month, month and day-of-week options of spec are all set to *
(spec string)
| 292 | // validateDailySpec ensures that the day-of-month, month and day-of-week |
| 293 | // options of spec are all set to * |
| 294 | func validateDailySpec(spec string) error { |
| 295 | parts := strings.Fields(spec) |
| 296 | if len(parts) < 5 { |
| 297 | return xerrors.Errorf("expected schedule to consist of 5 fields with an optional CRON_TZ=<timezone> prefix") |
| 298 | } |
| 299 | if len(parts) == 6 { |
| 300 | parts = parts[1:] |
| 301 | } |
| 302 | if parts[2] != "*" || parts[3] != "*" || parts[4] != "*" { |
| 303 | return xerrors.Errorf("expected day-of-month, month and day-of-week to be *") |
| 304 | } |
| 305 | return nil |
| 306 | } |
| 307 | |
| 308 | // validateTimeRangeSpec ensures that the minutes field is set to * |
| 309 | func validateTimeRangeSpec(spec string) error { |