taskrunner

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

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")
)

Functions

This section is empty.

Types

type Action

type Action func() (res Result)

type Group

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

func NewGroup

func NewGroup(title string) *Group

func (*Group) Task

func (g *Group) Task(name string, action Action) uuid.UUID

func (*Group) TaskD

func (g *Group) TaskD(name string, dependency string, action Action) uuid.UUID

TaskD adds task which depends on another tasks to be succsessful

type Result

type Result struct {
	Status     string
	State      State
	Decription string
	// contains filtered or unexported fields
}

func Failure

func Failure(status, desc string) Result

Failure utility function to create Result with state FAILURE

func Success

func Success(status, desc string) Result

Success utility function to create Result with state SUCCESS

func Warn

func Warn(status, desc string) Result

Warn utility function to create Result with state WARNING

type Runner

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

func New

func New(title string) *Runner

func (*Runner) Add

func (r *Runner) Add(group *Group) error

func (*Runner) Run

func (r *Runner) Run(what string) error

Run executes all tasks based on what pattern <group>.<task>

func (*Runner) WithColors

func (r *Runner) WithColors(colors branding.ColorPalette) *Runner

type State

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

type Task

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

Jump to

Keyboard shortcuts

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