tasks

package
v0.109.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 4 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericTask

type GenericTask struct {
	Description string
	Doer        func() error
}

func (*GenericTask) Describe

func (t *GenericTask) Describe() string

func (*GenericTask) Do

func (t *GenericTask) Do(errCh chan error) error

type SynchronousTask added in v0.39.0

type SynchronousTask struct {
	SynchronousTaskIface
}

func (SynchronousTask) Do added in v0.39.0

func (t SynchronousTask) Do(errCh chan error) error

type SynchronousTaskIface added in v0.39.0

type SynchronousTaskIface interface {
	Describe() string
	Do() error
}

type Task

type Task interface {
	Describe() string
	Do(chan error) error
}

Task is a common interface for the stack manager tasks

type TaskTree

type TaskTree struct {
	Tasks     []Task
	Parallel  bool
	PlanMode  bool
	IsSubTask bool
}

TaskTree wraps a set of tasks

func (*TaskTree) Append

func (t *TaskTree) Append(newTasks ...Task)

Append new tasks to the set

func (*TaskTree) Describe

func (t *TaskTree) Describe() string

Describe collects all tasks which have been added to the task tree. This is a lazy tree which does not track its nodes in any form. This function is recursively called from the rest of the task Describes and eventually returns a collection of all the tasks' `Info` value.

func (*TaskTree) Do

func (t *TaskTree) Do(allErrs chan error) error

Do will run through the set in the background, it may return an error immediately, or eventually write to the errs channel; it will close the channel once all tasks are completed

func (*TaskTree) DoAllSync

func (t *TaskTree) DoAllSync() []error

DoAllSync will run through the set in the foregrounds and return all the errors in a slice

func (*TaskTree) Len

func (t *TaskTree) Len() int

Len returns number of tasks in the set

type TaskWithNameParam

type TaskWithNameParam struct {
	Info string
	Name string
	Call func(chan error, string) error
}

func (*TaskWithNameParam) Describe

func (t *TaskWithNameParam) Describe() string

func (*TaskWithNameParam) Do

func (t *TaskWithNameParam) Do(errs chan error) error

type TaskWithoutParams

type TaskWithoutParams struct {
	Info string
	Call func(chan error) error
}

func (*TaskWithoutParams) Describe

func (t *TaskWithoutParams) Describe() string

func (*TaskWithoutParams) Do

func (t *TaskWithoutParams) Do(errs chan error) error

Jump to

Keyboard shortcuts

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