Documentation ¶
Overview ¶
Package tasks contains an abstraction of tasks and their state. The task abstraction breaks the coupling between functions that perform a composite task and feedback to a user about the progress of each step of the composite task.
Index ¶
- type Task
- func (t Task) FatalIff(condition bool, format string, args ...interface{})
- func (t Task) FatalOnError(err error)
- func (t Task) Fatalf(format string, args ...interface{})
- func (t Task) Printf(format string, args ...interface{})
- func (t Task) Step() *Task
- func (t Task) Track(description string, workload func() error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct { ErrorExitCode int Output io.Writer Error io.Writer // contains filtered or unexported fields }
The Task struct holds the necessary information to produce output for users that execute a multi-step process.
func (Task) FatalIff ¶
FatalIff is a function that logs any string to system err and causes the application to exit, if a condition matches. It provides the same formatting as the fmt package does.
func (Task) FatalOnError ¶
FatalOnError is a function that logs any error to system err and causes the application to exit, if a condition matches.
func (Task) Fatalf ¶
Fatalf is a function that logs any string to system err and causes the application to exit. It provides the same formatting as the fmt package does.
func (Task) Printf ¶
Printf is a function that logs any string to system out. It provides the same formatting as the fmt package does.