Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FmtPrinter ¶
type FmtPrinter struct{}
FmtPrinter is the default Printer implementation using fmt. It prints to stdout.
func (*FmtPrinter) PrintWithoutNewline ¶
func (p *FmtPrinter) PrintWithoutNewline(text string)
PrintWithoutNewline prints text to stdout without a newline.
type Printer ¶
type Printer interface {
// PrintWithoutNewline prints text without adding a newline.
PrintWithoutNewline(text string)
// Println prints a newline.
Println()
}
Printer defines the interface for printing to output. This abstraction allows injecting custom output implementations for testing or directing output to different destinations.
type SimpleDots ¶
type SimpleDots struct {
// contains filtered or unexported fields
}
SimpleDots provides periodic output for long-running operations in CI environments. It prints dots at regular intervals to show that work is progressing.
func NewDefaultSimpleDots ¶
func NewDefaultSimpleDots(printer Printer) *SimpleDots
NewDefaultSimpleDots creates a SimpleDots with a default 5-second interval.
func NewSimpleDotsWithInterval ¶
func NewSimpleDotsWithInterval(interval time.Duration, printer Printer) *SimpleDots
NewSimpleDotsWithInterval creates a new SimpleDots with the given interval.
func NewSimpleDotsWithTicker ¶
func NewSimpleDotsWithTicker(printer Printer, ticker Ticker) *SimpleDots
NewSimpleDotsWithTicker creates a new SimpleDots with a custom Ticker for testing.
func (*SimpleDots) Run ¶
func (t *SimpleDots) Run(action func() error) error
Run starts the progress dots and executes the given action.