progress

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Progress

type Progress struct {
	Title            string
	CurrentFile      string
	CurrentFileNum   int
	TotalFiles       int
	BytesTransferred int64
	TotalBytes       int64
	// contains filtered or unexported fields
}

Progress represents a progress bar display with elapsed time tracking

func New

func New() *Progress

New creates a new progress display

func (*Progress) Elapsed

func (p *Progress) Elapsed() time.Duration

Elapsed returns the elapsed duration since Start was called

func (*Progress) Reset

func (p *Progress) Reset()

Reset resets the progress state including the timer

func (*Progress) SetProgress

func (p *Progress) SetProgress(title, currentFile string, currentNum, totalFiles int, transferred, total int64)

SetProgress updates the progress state

func (*Progress) SetShowElapsed

func (p *Progress) SetShowElapsed(show bool)

SetShowElapsed controls whether elapsed time is displayed

func (*Progress) SetSize

func (p *Progress) SetSize(width int)

SetSize sets the width of the progress bar

func (*Progress) Start

func (p *Progress) Start()

Start begins elapsed time tracking

func (*Progress) View

func (p *Progress) View() string

View renders the progress bar

type ProgressUpdate

type ProgressUpdate struct {
	BytesTransferred int64
	TotalBytes       int64
	CurrentFile      string
	CurrentFileNum   int
	TotalFiles       int
	Done             bool  // True when operation is complete
	Error            error // Non-nil if operation failed
}

ProgressUpdate is a message sent to update progress

Jump to

Keyboard shortcuts

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