Documentation ¶
Index ¶
Constants ¶
View Source
const ( GtaskGroupNameKey = "GTASK_GROUP_NAME" GtaskUserKey = "GTASK_USER" GtaskDirKey = "GTASK_DIR" GtaskIDKey = "GTASK_ID" )
View Source
const ( Pending int = iota Succeed Failed Skipped )
Variables ¶
This section is empty.
Functions ¶
func PrepareScheduledTasks ¶
func PrepareWorkerTasks ¶
func PrepareWorkerTasks(tasks WorkerTasks, groupName, user, workingDir string, enVars map[string]string)
Types ¶
type ScheduledTask ¶
type ScheduledTask struct { Id string `mapstructure:"id" validate:"required,excludesall=!@#$ "` CronExpr string `mapstructure:"expr" validate:"required,cron-expr"` Command string `mapstructure:"command" validate:"required"` Expression string `mapstructure:"if"` Directory string `mapstructure:"directory" validate:"omitempty,required,dirpath"` Envs map[string]string `mapstructure:"environments"` LatestTaskResult *TaskResult Logger *slog.Logger }
func (*ScheduledTask) Execute ¶
func (s *ScheduledTask) Execute() *TaskResult
type ScheduledTasks ¶
type ScheduledTasks = []*ScheduledTask
type TaskResult ¶
type TaskResult struct { Status int Error error Output bytes.Buffer Task *ScheduledTask StartAt time.Time FinishAt time.Time }
func (*TaskResult) StatusString ¶
func (t *TaskResult) StatusString() string
type WorkerTask ¶
type WorkerTask struct { Id string `mapstructure:"id" validate:"required,excludesall=!@#$ "` Command string `mapstructure:"command" validate:"required"` GroupName string Expression string `mapstructure:"if"` User string `mapstructure:"user" validate:"omitempty,required,alphanum"` Directory string `mapstructure:"directory" validate:"omitempty,required,dirpath"` Envs map[string]string `mapstructure:"environments"` }
func (*WorkerTask) PrefixedName ¶ added in v0.2.2
func (w *WorkerTask) PrefixedName() string
type WorkerTasks ¶
type WorkerTasks = []*WorkerTask
Click to show internal directories.
Click to hide internal directories.