Files
keyhunter/pkg/scheduler/jobs.go
salvacybersec c71faa97f5 feat(17-02): implement scheduler package with gocron wrapper and job lifecycle
- Scheduler wraps gocron with Start/Stop lifecycle
- Start loads enabled jobs from DB and registers cron schedules
- AddJob/RemoveJob persist to DB and sync with gocron
- RunJob for manual trigger with OnComplete callback
- JobResult struct for notification bridge
- Promote gocron/v2 v2.19.1 to direct dependency
2026-04-06 17:27:00 +03:00

22 lines
477 B
Go

package scheduler
import "time"
// Job represents a scheduled scan job with its runtime function.
type Job struct {
Name string
CronExpr string
ScanCommand string
NotifyTelegram bool
Enabled bool
RunFunc func(ctx interface{}) (int, error)
}
// JobResult contains the outcome of a scheduled or manually triggered scan job.
type JobResult struct {
JobName string
FindingCount int
Duration time.Duration
Error error
}