Documentation ¶
Index ¶
- type Sched
- type Task
- func (t *Task) Cancel()
- func (t *Task) Execute() error
- func (t *Task) ExecuteWithContext(ctx context.Context) error
- func (t *Task) GetIntervalSeconds() int64
- func (t *Task) IsDisabled() bool
- func (t *Task) IsExecuted() bool
- func (t *Task) IsFinished() bool
- func (t *Task) IsInScheduling() bool
- func (t *Task) IsWorking() bool
- func (t *Task) JustExecuteNotRecording()
- func (t *Task) LastExecutedDate() (time.Time, error)
- func (t *Task) NextExecuteDate() (time.Time, error)
- func (t *Task) OnBeforeExecuting(tag string, callback TaskCallback) error
- func (t *Task) OnCanceled(tag string, callback TaskCallback) error
- func (t *Task) OnEveryExecuted(tag string, callback TaskCallback) error
- func (t *Task) OnFinished(tag string, callback TaskCallback) error
- func (t *Task) OnScheduleStart(tag string, callback TaskCallback) error
- func (t *Task) SetDisabled(b bool)
- type TaskCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sched ¶
type Sched struct {
// contains filtered or unexported fields
}
func (*Sched) ForeachTask ¶
type Task ¶
type Task struct { // 任务 ID ID string // 任务的启动时间 Start time.Time // 任务的停止时间 End time.Time // contains filtered or unexported fields }
func (*Task) GetIntervalSeconds ¶
func (*Task) IsDisabled ¶
func (*Task) IsExecuted ¶
func (*Task) IsInScheduling ¶
func (*Task) JustExecuteNotRecording ¶
func (t *Task) JustExecuteNotRecording()
func (*Task) OnBeforeExecuting ¶
func (t *Task) OnBeforeExecuting(tag string, callback TaskCallback) error
func (*Task) OnCanceled ¶
func (t *Task) OnCanceled(tag string, callback TaskCallback) error
func (*Task) OnEveryExecuted ¶
func (t *Task) OnEveryExecuted(tag string, callback TaskCallback) error
func (*Task) OnFinished ¶
func (t *Task) OnFinished(tag string, callback TaskCallback) error
func (*Task) OnScheduleStart ¶
func (t *Task) OnScheduleStart(tag string, callback TaskCallback) error
func (*Task) SetDisabled ¶
type TaskCallback ¶
type TaskCallback func(t *Task)
Click to show internal directories.
Click to hide internal directories.