paraprogress

package
v0.1.0-18-g5afcef2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	INDENTS = 4
	LOGLEN  = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ParaProgress

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

func NewParaProgress

func NewParaProgress(processes []*Process, opts ...ParaProgressOption) (*ParaProgress, error)

func (ParaProgress) Init

func (md ParaProgress) Init() tea.Cmd

func (*ParaProgress) Start

func (pd *ParaProgress) Start() error

func (*ParaProgress) Update

func (md *ParaProgress) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ParaProgress) View

func (md ParaProgress) View() string

type ParaProgressOption

type ParaProgressOption func(md *ParaProgress) error

func IsParallel

func IsParallel(parallel bool) ParaProgressOption

func WithFailFast

func WithFailFast(failFast bool) ParaProgressOption

func WithLogger

func WithLogger(l log.Logger) ParaProgressOption

func WithRenderer

func WithRenderer(norender bool) ParaProgressOption

type Process

type Process struct {
	Name      string
	NameWidth int
	Status    ProcessStatus
	// contains filtered or unexported fields
}

Process ...

func NewProcess

func NewProcess(name string, processFunc func(log.Logger, func(float64)) error) *Process

func (*Process) Init

func (p *Process) Init() tea.Cmd

func (*Process) Start

func (p *Process) Start() tea.Cmd

func (*Process) Update

func (d *Process) Update(msg tea.Msg) (*Process, tea.Cmd)

func (Process) View

func (p Process) View() string

func (*Process) Write

func (p *Process) Write(b []byte) (int, error)

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

type ProcessStatus

type ProcessStatus uint
const (
	StatusPending ProcessStatus = iota
	StatusRunning
	StatusFailed
	StatusSuccess
)

type ProgressMsg

type ProgressMsg struct {
	ID int
	// contains filtered or unexported fields
}

ProgressMsg is sent when an update in the progress percentage occurs.

type StatusMsg

type StatusMsg struct {
	ID int
	// contains filtered or unexported fields
}

StatusMsg is sent when the stopwatch should start or stop.

Jump to

Keyboard shortcuts

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