taskrunner

package module
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 16 Imported by: 2

README

taskrunner


License: Apache-2.0
Created: 01.03.2025
Copyright: 2025 The Happy Authors

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error                    = errors.New("taskrunner")
	ErrCompletedWithFailures = fmt.Errorf("%w: completed with failures", Error)
)

Functions

This section is empty.

Types

type Action

type Action func(ex *Executor) (res Result)

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func (*Executor) AddTick

func (e *Executor) AddTick()

AddTick adds a tick to the executor which is affecting the executor's progress bar.

func (*Executor) Println

func (e *Executor) Println(a ...any)

func (*Executor) Program

func (e *Executor) Program() *tea.Program

func (*Executor) Stdout

func (e *Executor) Stdout() *os.File

func (*Executor) Subtask

func (e *Executor) Subtask(name string, action Action) TaskID

func (*Executor) SubtaskD

func (e *Executor) SubtaskD(dep TaskID, name string, action Action) TaskID

type OutputMsg

type OutputMsg string

type Result

type Result struct {
	// contains filtered or unexported fields
}

func Failure

func Failure(msg string) Result

Failure utility function to create Result with state FAILURE

func Info

func Info(msg string) Result

Info utility function to create Result with state INFO

func Notice

func Notice(msg string) Result

Notice utility function to create Result with state INFO

func Skip

func Skip(msg string) Result

Skip utility function to create Result with state FAILURE

func Success

func Success(msg string) Result

Success utility function to create Result with state SUCCESS

func Warn

func Warn(msg string) Result

Warn utility function to create Result with state WARNING

func (Result) WithDesc

func (r Result) WithDesc(desc string) Result

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func New

func New(name string) *Runner

func (*Runner) Add

func (tr *Runner) Add(name string, action Action) TaskID

Add adds a task without any dependencies.

func (*Runner) AddD

func (tr *Runner) AddD(dep TaskID, name string, action Action) TaskID

AddD adds a task with a dependency on other task.

func (*Runner) AddTask

func (tr *Runner) AddTask(task Task) TaskID

AddTask adds a task to runner.

func (*Runner) Run

func (tr *Runner) Run() error

type SetStatusMsg

type SetStatusMsg string

type State

type State uint
const (
	SKIPPED State = iota
	SUCCESS
	INFO
	NOTICE
	WARNING
	FAILURE
)

type Task

type Task struct {
	// contains filtered or unexported fields
}

func NewTask

func NewTask(name string, action Action) Task

func (Task) DependsOn

func (t Task) DependsOn(dep TaskID) Task

func (Task) ID

func (t Task) ID() TaskID

type TaskID

type TaskID = uuid.UUID

Jump to

Keyboard shortcuts

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