3136eb862f
Pure functions for parsing dagu-compatible YAML, validating DAG structure, topological sorting with parallel levels (Kahn's algorithm), and env variable resolution. Also adds cron_match for schedule matching. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 lines
360 B
Go
13 lines
360 B
Go
package core
|
|
|
|
import "time"
|
|
|
|
// CronMatch returns true if time t matches all fields of the cron schedule.
|
|
func CronMatch(sched CronSchedule, t time.Time) bool {
|
|
return intIn(t.Minute(), sched.Minute) &&
|
|
intIn(t.Hour(), sched.Hour) &&
|
|
intIn(t.Day(), sched.DayOfMonth) &&
|
|
intIn(int(t.Month()), sched.Month) &&
|
|
intIn(int(t.Weekday()), sched.DayOfWeek)
|
|
}
|