oc-lib/models/workflow/workflow_schedule.go

25 lines
715 B
Go
Raw Normal View History

2024-08-30 09:14:03 +02:00
package workflow
2024-07-19 10:54:58 +02:00
import "time"
2024-08-13 09:56:09 +02:00
// WorkflowSchedule is a struct that contains the scheduling information of a workflow
type ScheduleMode int
const (
TASK ScheduleMode = iota
SERVICE
)
2024-07-19 10:54:58 +02:00
type WorkflowSchedule struct {
2024-08-13 09:56:09 +02:00
Mode int64 `json:"mode" bson:"mode" validate:"required"`
2024-08-06 08:40:05 +02:00
Name string `json:"name" bson:"name" validate:"required"`
2024-08-12 09:30:07 +02:00
Start *time.Time `json:"start" bson:"start" validate:"required,ltfield=End"`
2024-07-30 09:20:33 +02:00
End *time.Time `json:"end,omitempty" bson:"end,omitempty"`
2024-08-08 11:14:24 +02:00
Cron string `json:"cron,omitempty" bson:"cron,omitempty"` // ss mm hh dd MM dw task
2024-07-19 10:54:58 +02:00
}
2024-07-23 16:14:46 +02:00
func (ws *WorkflowSchedule) GetAllDates() (timetable []time.Time) {
2024-07-19 10:54:58 +02:00
// Return all the execution time generated by the Cron
return
2024-07-23 16:14:46 +02:00
}