Documentation
¶
Index ¶
- Variables
- type ActivatedState
- func (s *ActivatedState) Delete(ctx context.Context, t *task.ScriptTask) error
- func (s *ActivatedState) Run(ctx context.Context, t *task.ScriptTask) error
- func (s *ActivatedState) Start(ctx context.Context, t *task.ScriptTask) error
- func (s *ActivatedState) Stop(ctx context.Context, t *task.ScriptTask) error
- func (s *ActivatedState) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
- type CompletedState
- func (s *CompletedState) Delete(ctx context.Context, t *task.ScriptTask) error
- func (s *CompletedState) Run(ctx context.Context, t *task.ScriptTask) error
- func (s *CompletedState) Start(ctx context.Context, t *task.ScriptTask) error
- func (s *CompletedState) Stop(ctx context.Context, t *task.ScriptTask) error
- func (s *CompletedState) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
- type NotRunningState
- func (s *NotRunningState) Delete(ctx context.Context, t *task.ScriptTask) error
- func (s *NotRunningState) Run(ctx context.Context, t *task.ScriptTask) error
- func (s *NotRunningState) Start(ctx context.Context, t *task.ScriptTask) error
- func (s *NotRunningState) Stop(ctx context.Context, t *task.ScriptTask) error
- func (s *NotRunningState) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
- type RunningState
- func (s *RunningState) Delete(ctx context.Context, t *task.ScriptTask) error
- func (s *RunningState) Run(ctx context.Context, t *task.ScriptTask) error
- func (s *RunningState) Start(ctx context.Context, t *task.ScriptTask) error
- func (s *RunningState) Stop(ctx context.Context, t *task.ScriptTask) error
- func (s *RunningState) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
- type StoppedState
- func (s *StoppedState) Delete(ctx context.Context, t *task.ScriptTask) error
- func (s *StoppedState) Run(ctx context.Context, t *task.ScriptTask) error
- func (s *StoppedState) Start(ctx context.Context, t *task.ScriptTask) error
- func (s *StoppedState) Stop(ctx context.Context, t *task.ScriptTask) error
- func (s *StoppedState) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
- type TState
- type TaskStateCommon
- func (s *TaskStateCommon) Delete(ctx context.Context, t *task.ScriptTask) error
- func (s *TaskStateCommon) Run(ctx context.Context, t *task.ScriptTask) (err error)
- func (s *TaskStateCommon) Start(ctx context.Context, t *task.ScriptTask) error
- func (s *TaskStateCommon) Stop(ctx context.Context, t *task.ScriptTask) error
- func (s *TaskStateCommon) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
Constants ¶
This section is empty.
Variables ¶
View Source
var UnsupportedOperationErr = E.Message("当前状态不支持该操作")
Functions ¶
This section is empty.
Types ¶
type ActivatedState ¶
type ActivatedState struct {
// contains filtered or unexported fields
}
func GetActivatedState ¶
func GetActivatedState() *ActivatedState
func (*ActivatedState) Delete ¶
func (s *ActivatedState) Delete(ctx context.Context, t *task.ScriptTask) error
func (*ActivatedState) Run ¶
func (s *ActivatedState) Run(ctx context.Context, t *task.ScriptTask) error
func (*ActivatedState) Start ¶
func (s *ActivatedState) Start(ctx context.Context, t *task.ScriptTask) error
func (*ActivatedState) Stop ¶
func (s *ActivatedState) Stop(ctx context.Context, t *task.ScriptTask) error
func (*ActivatedState) Update ¶
func (s *ActivatedState) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
type CompletedState ¶
type CompletedState struct {
// contains filtered or unexported fields
}
func GetCompletedState ¶
func GetCompletedState() *CompletedState
func (*CompletedState) Delete ¶
func (s *CompletedState) Delete(ctx context.Context, t *task.ScriptTask) error
func (*CompletedState) Run ¶
func (s *CompletedState) Run(ctx context.Context, t *task.ScriptTask) error
func (*CompletedState) Start ¶
func (s *CompletedState) Start(ctx context.Context, t *task.ScriptTask) error
func (*CompletedState) Stop ¶
func (s *CompletedState) Stop(ctx context.Context, t *task.ScriptTask) error
func (*CompletedState) Update ¶
func (s *CompletedState) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
type NotRunningState ¶
type NotRunningState struct {
// contains filtered or unexported fields
}
func GetNotRunningState ¶
func GetNotRunningState() *NotRunningState
func (*NotRunningState) Delete ¶
func (s *NotRunningState) Delete(ctx context.Context, t *task.ScriptTask) error
func (*NotRunningState) Run ¶
func (s *NotRunningState) Run(ctx context.Context, t *task.ScriptTask) error
func (*NotRunningState) Start ¶
func (s *NotRunningState) Start(ctx context.Context, t *task.ScriptTask) error
func (*NotRunningState) Stop ¶
func (s *NotRunningState) Stop(ctx context.Context, t *task.ScriptTask) error
func (*NotRunningState) Update ¶
func (s *NotRunningState) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
type RunningState ¶
type RunningState struct {
// contains filtered or unexported fields
}
func GetRunningState ¶
func GetRunningState() *RunningState
func (*RunningState) Delete ¶
func (s *RunningState) Delete(ctx context.Context, t *task.ScriptTask) error
func (*RunningState) Run ¶
func (s *RunningState) Run(ctx context.Context, t *task.ScriptTask) error
func (*RunningState) Start ¶
func (s *RunningState) Start(ctx context.Context, t *task.ScriptTask) error
func (*RunningState) Stop ¶
func (s *RunningState) Stop(ctx context.Context, t *task.ScriptTask) error
func (*RunningState) Update ¶
func (s *RunningState) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
type StoppedState ¶
type StoppedState struct {
// contains filtered or unexported fields
}
func GetStoppedState ¶
func GetStoppedState() *StoppedState
func (*StoppedState) Delete ¶
func (s *StoppedState) Delete(ctx context.Context, t *task.ScriptTask) error
func (*StoppedState) Run ¶
func (s *StoppedState) Run(ctx context.Context, t *task.ScriptTask) error
func (*StoppedState) Start ¶
func (s *StoppedState) Start(ctx context.Context, t *task.ScriptTask) error
func (*StoppedState) Stop ¶
func (s *StoppedState) Stop(ctx context.Context, t *task.ScriptTask) error
func (*StoppedState) Update ¶
func (s *StoppedState) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
type TState ¶
type TState interface {
Start(ctx context.Context, t *task.ScriptTask) error
Run(ctx context.Context, t *task.ScriptTask) error
Stop(ctx context.Context, t *task.ScriptTask) error
Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
Delete(ctx context.Context, t *task.ScriptTask) error
}
type TaskStateCommon ¶
type TaskStateCommon struct {
// contains filtered or unexported fields
}
func GetTaskStateCommon ¶
func GetTaskStateCommon() *TaskStateCommon
func (*TaskStateCommon) Delete ¶
func (s *TaskStateCommon) Delete(ctx context.Context, t *task.ScriptTask) error
func (*TaskStateCommon) Run ¶
func (s *TaskStateCommon) Run(ctx context.Context, t *task.ScriptTask) (err error)
func (*TaskStateCommon) Start ¶
func (s *TaskStateCommon) Start(ctx context.Context, t *task.ScriptTask) error
func (*TaskStateCommon) Stop ¶
func (s *TaskStateCommon) Stop(ctx context.Context, t *task.ScriptTask) error
func (*TaskStateCommon) Update ¶
func (s *TaskStateCommon) Update(ctx context.Context, info *req.ScriptTaskUpsertReq, t *task.ScriptTask) error
Click to show internal directories.
Click to hide internal directories.