tasks

package
v0.63.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 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 the set

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 foregounds 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