processtree

package
v0.1.0-24-ga60fd7e Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INDENTS = 4
	LOGLEN  = 5
)

Variables

This section is empty.

Functions

func TraverseTreeAndCall

func TraverseTreeAndCall(items []*ProcessTreeItem, callback func(*ProcessTreeItem) error) error

Types

type ProcessTree

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

func NewProcessTree

func NewProcessTree(opts []ProcessTreeOption, tree ...*ProcessTreeItem) (*ProcessTree, error)

func (*ProcessTree) Init

func (pt *ProcessTree) Init() tea.Cmd

func (*ProcessTree) Start

func (pt *ProcessTree) Start() error

func (*ProcessTree) Update

func (pt *ProcessTree) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ProcessTree) View

func (pt ProcessTree) View() string

type ProcessTreeItem

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

func NewProcessTreeItem

func NewProcessTreeItem(textLeft, textRight string, process SpinnerProcess, children ...*ProcessTreeItem) *ProcessTreeItem

func (*ProcessTreeItem) Write

func (pti *ProcessTreeItem) Write(p []byte) (int, error)

Write implements `io.Writer` so we can correctly direct the output from tree process to an inline fancy logger

type ProcessTreeOption

type ProcessTreeOption func(pt *ProcessTree) error

func IsParallel

func IsParallel(parallel bool) ProcessTreeOption

func WithFailFast

func WithFailFast(failFast bool) ProcessTreeOption

func WithLogger

func WithLogger(l log.Logger) ProcessTreeOption

func WithRenderer

func WithRenderer(norender bool) ProcessTreeOption

func WithVerb

func WithVerb(verb string) ProcessTreeOption

type SpinnerProcess

type SpinnerProcess func(l log.Logger) error

type SpinnerProcessStatus

type SpinnerProcessStatus uint
const (
	StatusPending SpinnerProcessStatus = iota
	StatusRunning
	StatusRunningChild
	StatusRunningButAChildHasFailed
	StatusFailed
	StatusFailedChild
	StatusSuccess
)

Jump to

Keyboard shortcuts

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