state

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

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 (*ActivatedState) Start

func (s *ActivatedState) Start(ctx context.Context, t *task.ScriptTask) error

func (*ActivatedState) Stop

func (*ActivatedState) Update

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 (*CompletedState) Start

func (s *CompletedState) Start(ctx context.Context, t *task.ScriptTask) error

func (*CompletedState) Stop

func (*CompletedState) Update

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 (*NotRunningState) Start

func (s *NotRunningState) Start(ctx context.Context, t *task.ScriptTask) error

func (*NotRunningState) Stop

func (*NotRunningState) Update

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

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

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 (*TaskStateCommon) Update

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL