tracker

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: MIT Imports: 2 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task interface {
	Name() string

	State() TaskState
	SetState(TaskState, ...string)

	Duration() time.Duration

	Messages() []string

	Output() []string
	AddOutput(...string)

	Child(name string) Task
	Children() []Task

	Lineage() []Task
}

Task provides methods to represent the state of a runnable work item.

func NewTask

func NewTask(updateHandler UpdateHandler) Task

type TaskState

type TaskState int

TaskState represents the current state of a task

const (
	// TaskStatePending indicates that a task has not yet started.
	TaskStatePending TaskState = iota
	// TaskStateInProgress indicates that a task is currently running.
	TaskStateInProgress
	// TaskStateSuccess indicates that a task has completed successfully.
	TaskStateSuccess
	// TaskStateWarning indicates that a task has completed with a non-fatal error condition.
	TaskStateWarning
	// TaskStateFailed indicates that a task has completed with a fatal error condition.
	TaskStateFailed
)

func (TaskState) String

func (t TaskState) String() string

type UpdateHandler

type UpdateHandler func(updatedTask Task)

UpdateHandler receives updates from a Task

Jump to

Keyboard shortcuts

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