Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( SpinnerDots = SpinnerStyle{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"} SpinnerLine = SpinnerStyle{"-", "\\", "|", "/"} SpinnerArrows = SpinnerStyle{"←", "↖", "↑", "↗", "→", "↘", "↓", "↙"} )
Predefined spinner styles.
Functions ¶
func IsInteractive ¶
func IsInteractive() bool
IsInteractive checks if the terminal is interactive. Checks if stdout or stderr is a terminal (not stdin, which may be piped).
Types ¶
type Bar ¶
type Bar struct {
// contains filtered or unexported fields
}
Bar displays a progress bar.
type Indicator ¶
type Indicator interface {
Start(message string)
Update(current, total int, message string)
Stop(message string)
Fail(message string)
}
Indicator provides progress feedback.
type NoOpIndicator ¶
type NoOpIndicator struct{}
NoOpIndicator does nothing (for non-interactive terminals).
func (*NoOpIndicator) Update ¶
func (n *NoOpIndicator) Update(current, total int, message string)
Update does nothing.
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner displays an indeterminate progress spinner.
func NewSpinnerWithStyle ¶
func NewSpinnerWithStyle(cfg Config, style SpinnerStyle) *Spinner
NewSpinnerWithStyle creates a spinner with the specified style.
type SpinnerStyle ¶
type SpinnerStyle []string
SpinnerStyle defines the animation frames for a spinner.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker manages progress for multi-stage operations.
func NewTracker ¶
NewTracker creates a new progress tracker.
func (*Tracker) CurrentStage ¶
CurrentStage returns the current stage index.
func (*Tracker) TotalStages ¶
TotalStages returns the total number of stages.
func (*Tracker) UpdateCurrent ¶
UpdateCurrent updates current stage progress.