tl

package
v0.1.0-alpha.10 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptionApplier

type OptionApplier func(o *option)

func WithExitOnError

func WithExitOnError(exitOnError bool) OptionApplier

type Result

type Result struct {
	Task     *Task
	TaskList *TaskList

	Enabled    bool
	Skipped    bool
	SkipReason string
	Hide       bool
	Error      bool
	Err        error

	SubResults []*Result
}

type Runner

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

func New

func New(tasks []*Task, options ...OptionApplier) *Runner

func (*Runner) Run

func (runner *Runner) Run() error

type Task

type Task struct {
	Title string
	Run   func(callback TaskCallback) error
	// PostRun runs after Run (even if Run failed) with result
	PostRun func(result *Result)
	Enable  func() bool

	Options []OptionApplier
	// contains filtered or unexported fields
}

func NewTask

func NewTask(title string, run func(callback TaskCallback) error, options ...OptionApplier) *Task

func (*Task) Id

func (t *Task) Id() string

Id only available after run

type TaskCallback

type TaskCallback interface {
	GetTask() *Task
	//Log(msg string)
	Hide()
	Skip(reason string)
	AddSubTaskList(taskList *TaskList)
	AddSubTask(tasks ...*Task)
}

type TaskList

type TaskList struct {
	Tasks   []*Task
	Options []OptionApplier
	// contains filtered or unexported fields
}

func NewTaskList

func NewTaskList(tasks []*Task, options ...OptionApplier) *TaskList

Jump to

Keyboard shortcuts

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