tui

package
v0.0.0-...-b17ebf5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SpinnerStyle []string = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}

	Check string = "✓"
	Cross string = "⨯"
	Yes   string = Check
	No    string = Cross
)

Functions

func AddDefaultSpinner

func AddDefaultSpinner(p *mpb.Progress, name string, stage string, cmsg string, opts ...mpb.BarOption) *mpb.Bar

Types

type Progress

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

func New

func New(ctx context.Context, out io.Writer, options ...mpb.ContainerOption) *Progress

New initiates a new progress tracking container

func (*Progress) Abort

func (p *Progress) Abort()

Abort will abort all currently active trackers and wait for them to finish before returning

func (*Progress) AddTracker

func (p *Progress) AddTracker(name, state, endMsg string, opts ...mpb.BarOption) *Tracker

AddTracker will add a status tracker to the appliance the returned channel is to be used by other functions to update the tracker progress

func (*Progress) Complete

func (p *Progress) Complete()

Complete will complete all currently active trackers and wait for them to finish before returning

func (*Progress) FileDownloadProgress

func (p *Progress) FileDownloadProgress(name, endMsg string, size int64, width int, reader io.Reader, opts ...mpb.BarOption) io.ReadCloser

func (*Progress) FileUploadProgress

func (p *Progress) FileUploadProgress(name, endMsg string, size int64, reader io.Reader) (io.ReadCloser, *Tracker)

func (*Progress) Wait

func (p *Progress) Wait()

Wait will wait for all progress bars to complete with a timeout If deadline is reached before the bars are complete, it will abort all bars remaining and return

func (*Progress) WriteLine

func (p *Progress) WriteLine(s, prepend string)

type Tracker

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

func (*Tracker) Current

func (t *Tracker) Current() string

func (*Tracker) Fail

func (t *Tracker) Fail(s string)

func (*Tracker) Update

func (t *Tracker) Update(s string)

Update is used to send strings for the tracker to present in the progress tracking

func (*Tracker) Watch

func (t *Tracker) Watch(until, failOn []string)

Watch initiates the progress tracking for each appliance update It succeeds if the status written to the statusReport is in the until slice It will abort the tracker if status the same as included in the failOn slice

Jump to

Keyboard shortcuts

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