progress

package
v0.0.0-...-81fcdeb Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package progress provides progress bar components for cbwsh.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bar

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

Bar represents a progress bar component.

func NewBar

func NewBar() *Bar

NewBar creates a new progress bar.

func NewBarWithColors

func NewBarWithColors(colorA, colorB string) *Bar

NewBarWithColors creates a new progress bar with custom colors.

func (*Bar) Finish

func (b *Bar) Finish()

Finish completes the progress.

func (*Bar) Increment

func (b *Bar) Increment()

Increment increments progress by one.

func (*Bar) IncrementBy

func (b *Bar) IncrementBy(amount int)

IncrementBy increments progress by a specific amount.

func (*Bar) IsFinished

func (b *Bar) IsFinished() bool

IsFinished returns whether the progress is complete.

func (*Bar) Percent

func (b *Bar) Percent() float64

Percent returns the current progress percentage.

func (*Bar) SetMessage

func (b *Bar) SetMessage(message string)

SetMessage sets the progress message.

func (*Bar) SetWidth

func (b *Bar) SetWidth(width int)

SetWidth sets the progress bar width.

func (*Bar) Start

func (b *Bar) Start(total int)

Start starts progress tracking.

func (*Bar) View

func (b *Bar) View() string

View returns the progress view string.

type Model

type Model struct {
	Bar *Bar
	// contains filtered or unexported fields
}

Model is a bubbletea model for a progress bar.

func NewModel

func NewModel() Model

NewModel creates a new progress model.

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages.

func (Model) View

func (m Model) View() string

View renders the model.

type MultiBar

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

MultiBar manages multiple progress bars.

func NewMultiBar

func NewMultiBar() *MultiBar

NewMultiBar creates a new multi-bar progress tracker.

func (*MultiBar) Add

func (m *MultiBar) Add(name string, total int) *Bar

Add adds a new progress bar.

func (*MultiBar) AllFinished

func (m *MultiBar) AllFinished() bool

AllFinished returns whether all bars are finished.

func (*MultiBar) Get

func (m *MultiBar) Get(name string) (*Bar, bool)

Get returns a progress bar by name.

func (*MultiBar) Remove

func (m *MultiBar) Remove(name string)

Remove removes a progress bar.

func (*MultiBar) View

func (m *MultiBar) View() string

View returns the combined view of all progress bars.

type Spinner

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

Spinner represents a spinner component.

func NewSpinner

func NewSpinner() *Spinner

NewSpinner creates a new spinner.

func (*Spinner) SetMessage

func (s *Spinner) SetMessage(message string)

SetMessage sets the spinner message.

func (*Spinner) Start

func (s *Spinner) Start()

Start starts the spinner.

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop stops the spinner.

func (*Spinner) Tick

func (s *Spinner) Tick()

Tick advances the spinner.

func (*Spinner) View

func (s *Spinner) View() string

View returns the spinner view.

Jump to

Keyboard shortcuts

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