parse parses the tokens into a cron expression
()
| 76 | |
| 77 | // parse parses the tokens into a cron expression |
| 78 | func (p *ScheduleParser) parse() (string, error) { |
| 79 | if len(p.tokens) == 0 { |
| 80 | return "", errors.New("no tokens to parse") |
| 81 | } |
| 82 | |
| 83 | // Check for interval-based schedules: "every N minutes|hours" |
| 84 | if p.tokens[0] == "every" { |
| 85 | return p.parseInterval() |
| 86 | } |
| 87 | |
| 88 | // Otherwise, parse as base schedule (daily, weekly, monthly, yearly) |
| 89 | return p.parseBase() |
| 90 | } |
| 91 | |
| 92 | // parseInterval parses interval-based schedules like "every 10 minutes" or "every 2h" |
| 93 | func (p *ScheduleParser) parseInterval() (string, error) { |