Documentation ¶
Index ¶
- Variables
- type Hooker
- func (h *Hooker) ExecuteAfter(ctx context.Context, task string, actionPerformed bool, errResult error)
- func (h *Hooker) ExecuteBefore(ctx context.Context, task string) (context.Context, error)
- func (h *Hooker) RunAfter(task string, fn actions.AfterTaskFunc) error
- func (h *Hooker) RunBefore(task string, fn actions.BeforeTaskFunc) error
- type Runner
- type Task
- type TaskManager
- func (tm *TaskManager) AddTask(name string, target deploy.Task) error
- func (tm *TaskManager) DisableTask(task string) error
- func (tm *TaskManager) HasTask(task string) bool
- func (tm *TaskManager) IsAfter(task1, task2 string) (bool, error)
- func (tm *TaskManager) IsBefore(task1, task2 string) (bool, error)
- func (tm *TaskManager) IsMasked(task string) (bool, error)
- func (tm *TaskManager) MaskTask(task string) error
- func (tm *TaskManager) UnmaskTask(task string) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTaskExists is returned when a task or // task name is expect to not exist but does. ErrTaskExists = errors.New("task exists") // ErrTaskNotExists is returned when a task is // expected to exists but doesn't. ErrTaskNotExists = errors.New("task does not exist") // ErrExecPhase is returned if the operation is not supported // during execution phase. That is, the TaskManager's Run() // method is called. ErrExecPhase = errors.New("operation not supported during execution phase") )
Functions ¶
This section is empty.
Types ¶
type Hooker ¶
type Hooker struct {
// contains filtered or unexported fields
}
Hooker allows to register before and after task execution hooks. It implements the actions.Hooker interface.
func (*Hooker) ExecuteAfter ¶
func (h *Hooker) ExecuteAfter(ctx context.Context, task string, actionPerformed bool, errResult error)
ExecuteAfter executes all AfterFunc that have been registered for task.
func (*Hooker) ExecuteBefore ¶
ExecuteBefore executes all BeforeFunc that have been registered for task. It aborts as soon as a function returns an error.
type Runner ¶
type Runner struct { *TaskManager *Hooker // contains filtered or unexported fields }
Runner executes a set of targets in order and aborts on the first error.
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
type TaskManager ¶
type TaskManager struct {
// contains filtered or unexported fields
}
TaskManager is responsible for managing tasks and implements the actions.TaskManager interface.
func NewTaskManager ¶
func NewTaskManager(l actions.Logger) *TaskManager
NewTaskManager returns a new task manager.
func (*TaskManager) AddTask ¶
func (tm *TaskManager) AddTask(name string, target deploy.Task) error
AddTask adds a new task to task manager.
func (*TaskManager) DisableTask ¶
func (tm *TaskManager) DisableTask(task string) error
DisableTask disables a task so it won't be executed during perperation and execution phase. Once disabled, a task cannot be enabled again. Refer to the actions.TaskManager interface for more information.
func (*TaskManager) HasTask ¶
func (tm *TaskManager) HasTask(task string) bool
HasTask returns true if task exists.
func (*TaskManager) IsAfter ¶
func (tm *TaskManager) IsAfter(task1, task2 string) (bool, error)
IsAfter returns true if task1 is executed after task2.
func (*TaskManager) IsBefore ¶
func (tm *TaskManager) IsBefore(task1, task2 string) (bool, error)
IsBefore returns true if task1 is executed before task2.
func (*TaskManager) IsMasked ¶
func (tm *TaskManager) IsMasked(task string) (bool, error)
IsMasked returns true if task is masked from execution.
func (*TaskManager) MaskTask ¶
func (tm *TaskManager) MaskTask(task string) error
MaskTask masks a task from execution.
func (*TaskManager) UnmaskTask ¶
func (tm *TaskManager) UnmaskTask(task string) error
UnmaskTask unmasks a task for execution.