Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTaskRunner ¶
func NewTaskRunner(opts ...Option) (runner *taskRunner)
Types ¶
type ConditionalExecutorFn ¶
type ConditionalExecutorFn func() bool
type ConditionalTask ¶
type ConditionalTask struct {
Description string
Action func(ctx context.Context) error
ShouldExecute func() bool
}
func (*ConditionalTask) Describe ¶
func (t *ConditionalTask) Describe() string
type NoOpOutput ¶
type NoOpOutput struct{}
func (NoOpOutput) ErrorF ¶
func (n NoOpOutput) ErrorF(_ string, _ ...interface{})
func (NoOpOutput) Next ¶
func (n NoOpOutput) Next()
func (NoOpOutput) PrintTaskProgress ¶
func (n NoOpOutput) PrintTaskProgress(_ string)
func (NoOpOutput) Printf ¶
func (n NoOpOutput) Printf(_ string, _ ...interface{})
type Option ¶
type Option func(tr *taskRunner) *taskRunner
func WithDiscardOutput ¶
func WithDiscardOutput() Option
func WithPTermOutput ¶
func WithPTermOutput(output *ptermTaskRunnerOutput) Option
func WithTimeout ¶
type SimpleTask ¶
func (*SimpleTask) Describe ¶
func (t *SimpleTask) Describe() string
type TaskActionFn ¶
type TaskRunnerMsg ¶
type TaskRunnerMsg interface {
Print(output TaskRunnerOutput)
Error() error
}
type TaskRunnerOutput ¶
type Tasker ¶
func NewConditionalTask ¶
func NewConditionalTask(desc string, task TaskActionFn, shouldExecuteFn ConditionalExecutorFn) Tasker
Click to show internal directories.
Click to hide internal directories.