Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrJobRunning = errors.New("job already running") ErrJobIsNotRunning = errors.New("job is not running") ErrJobFinished = errors.New("job already finished") ErrJobSkipped = errors.New("job skipped") ErrJobSuccess = errors.New("job already successful") )
Error variables for job states.
Functions ¶
This section is empty.
Types ¶
type Job ¶ added in v1.16.1
type Job interface { // Start starts the DAG. Start(ctx context.Context) error // Stop stops the DAG. Stop(ctx context.Context) error // Restart restarts the DAG. Restart(ctx context.Context) error }
Job is the interface for the actual DAG.
type JobManager ¶ added in v1.16.1
type JobManager interface { // Start initializes and starts the process of managing scheduled Jobs. Start(ctx context.Context, done chan any) error // Next returns the next scheduled jobs. Next(ctx context.Context, now time.Time) ([]*ScheduledJob, error) }
JobManager is responsible for managing scheduled Jobs.
func NewDAGJobManager ¶ added in v1.16.1
func NewDAGJobManager(dir string, client client.Client, executable, workDir string) JobManager
NewDAGJobManager creates a new DAG manager with the given configuration.
type ScheduleType ¶ added in v1.16.1
type ScheduleType int
ScheduleType is the type of schedule (start, stop, restart).
const ( ScheduleTypeStart ScheduleType = iota ScheduleTypeStop ScheduleTypeRestart )
func (ScheduleType) String ¶ added in v1.16.1
func (s ScheduleType) String() string
type ScheduledJob ¶ added in v1.16.1
type ScheduledJob struct { Next time.Time // Next is the time when the job should be run. Job Job Type ScheduleType // start, stop, restart }
ScheduledJob stores the next time a job should be run and the job itself.
func NewScheduledJob ¶ added in v1.16.1
func NewScheduledJob(next time.Time, job Job, typ ScheduleType) *ScheduledJob
NewScheduledJob creates a new ScheduledJob.
Directories
¶
Path | Synopsis |
---|---|
Package filenotify provides a mechanism for watching file(s) for changes.
|
Package filenotify provides a mechanism for watching file(s) for changes. |
Click to show internal directories.
Click to hide internal directories.