Files
fn_registry/functions/core/cron_match.md
T
egutierrez 47fac22230 chore: auto-commit (799 archivos)
- .claude/CLAUDE.md
- .claude/commands/subagentes.md
- .claude/rules/INDEX.md
- .mcp.json
- bash/functions/cybersecurity/analyze_dns.md
- bash/functions/cybersecurity/audit_http_headers.md
- bash/functions/cybersecurity/audit_ssh_config.md
- bash/functions/cybersecurity/check_firewall.md
- bash/functions/cybersecurity/detect_suspicious_users.md
- bash/functions/cybersecurity/encrypt_file.md
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:28:20 +02:00

1.5 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports params output tested tests test_file_path file_path
cron_match function go core 1.0.0 pure func CronMatch(sched CronSchedule, t time.Time) bool Verifica si un instante de tiempo coincide con un cron schedule. Compara los 5 campos (minuto, hora, dia del mes, mes, dia de la semana) y retorna true si todos coinciden.
cron
scheduling
matching
time
pure
pendiente-usar
cron_schedule_go_core
false
time
name desc
sched CronSchedule con listas de valores validos por campo (resultado de ParseCronExpr)
name desc
t instante de tiempo a verificar contra el schedule
true si t coincide con todos los campos del cron schedule true
9:00 AM coincide con 0 9 * * *
9:15 AM NO coincide con 0 9 * * *
lunes a las 9 coincide con 0 9 * * 1
domingo a las 9 NO coincide con 0 9 * * 1
wildcard * coincide con cualquier valor
specific month
functions/core/cron_match_test.go functions/core/cron_match.go

Ejemplo

sched, _ := ParseCronExpr("0 9 * * *")
t := time.Date(2026, 4, 11, 9, 0, 0, 0, time.UTC)
CronMatch(sched, t) // true

t2 := time.Date(2026, 4, 11, 10, 0, 0, 0, time.UTC)
CronMatch(sched, t2) // false

Notas

Funcion pura. Usa AND semantics para day_of_month y day_of_week (ambos deben coincidir), igual que NextCronTime en el mismo paquete. Reutiliza el helper intIn definido en next_cron_time.go (mismo paquete core).