Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Ctl is a global task controller instance Ctl = NewController() )
View Source
var ( // ExecutionCtl is a global execution controller. ExecutionCtl = NewExecutionController() )
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { // Stop the specified task. Stop(ctx context.Context, id int64) (err error) // Get the specified task. Get(ctx context.Context, id int64) (task *task.Task, err error) // List the tasks according to the query. List(ctx context.Context, query *q.Query) (tasks []*task.Task, err error) // Get the log of the specified task. GetLog(ctx context.Context, id int64) (log []byte, err error) // Count counts total. Count(ctx context.Context, query *q.Query) (int64, error) }
Controller manages the task
func NewController ¶
func NewController() Controller
NewController creates an instance of the default task controller.
type ExecutionController ¶
type ExecutionController interface { // Stop all linked tasks of the specified execution. Stop(ctx context.Context, id int64) (err error) // Delete the specified execution and its tasks. Delete(ctx context.Context, id int64) (err error) // Get the specified execution. Get(ctx context.Context, id int64) (execution *task.Execution, err error) // List executions according to the query. List(ctx context.Context, query *q.Query) (executions []*task.Execution, err error) // Count counts total. Count(ctx context.Context, query *q.Query) (int64, error) }
ExecutionController manages the execution.
func NewExecutionController ¶
func NewExecutionController() ExecutionController
NewExecutionController creates an instance of the default execution controller.
Click to show internal directories.
Click to hide internal directories.