mirror of
https://github.com/Fishwaldo/sched.git
synced 2025-03-15 19:41:46 +00:00
38 lines
732 B
Go
38 lines
732 B
Go
package sched
|
|
|
|
//State Indicate the state of the Schedule
|
|
type State int64
|
|
|
|
const (
|
|
//NEW Schedule has just been created and hasn't started before
|
|
NEW State = iota
|
|
|
|
// STARTED Start Schedule has started and is running.
|
|
STARTED
|
|
|
|
// STOPPING Schedule is Stopping and is waiting for all active jobs to finish.
|
|
STOPPING
|
|
|
|
// STOPPED Schedule has stopped and no longer scheduling new Jobs.
|
|
STOPPED
|
|
|
|
// FINISHED Schedule has finished, and will not be able to start again.
|
|
FINISHED
|
|
)
|
|
|
|
func (s State) String() string {
|
|
switch s {
|
|
case NEW:
|
|
return "NEW"
|
|
case STARTED:
|
|
return "STARTED"
|
|
case STOPPING:
|
|
return "STOPPING"
|
|
case STOPPED:
|
|
return "STOPPED"
|
|
case FINISHED:
|
|
return "FINISHED"
|
|
default:
|
|
return "UNKNOWN"
|
|
}
|
|
}
|