Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrExecSkipped = errors.New("not executed") ErrPanic = errors.New("panic error") )
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
Tasks *TaskMap
// contains filtered or unexported fields
}
func NewExecutor ¶
func NewExecutor() *Executor
NewExecutor creates a new Executor instance with a new TaskMap.
type Task ¶
type Task struct {
Id string
Fn func() error
DependsOn []string
Err error // execution error
Running bool // this task is running
Skip bool // this task is skipped due to an error from prior tasks
// contains filtered or unexported fields
}
Task is an object representing a named task and its next tasks.
type TaskMap ¶
type TaskMap struct {
// contains filtered or unexported fields
}
TaskMap is a synchronized map to store tasks using its Id as a key.
func NewTaskMap ¶
func NewTaskMap() *TaskMap
func (*TaskMap) GetTaskIds ¶
func (*TaskMap) RemoveTask ¶
type TaskResult ¶
type TaskResult []*Task
func (*TaskResult) Error ¶
func (t *TaskResult) Error() string
Error returns a combined error message.
func (*TaskResult) HasError ¶
func (t *TaskResult) HasError() bool
type TriggerSet ¶
type TriggerSet struct {
// contains filtered or unexported fields
}
TriggerSet is a set that returns true if the set is empty after removing an item. Its functions are all thread-safe.
func NewTriggerSet ¶
func NewTriggerSet() *TriggerSet
func (*TriggerSet) Add ¶
func (t *TriggerSet) Add(id string)
func (*TriggerSet) Remove ¶
func (t *TriggerSet) Remove(id string) bool
Click to show internal directories.
Click to hide internal directories.