Documentation
¶
Index ¶
- Constants
- type MultiProgress
- type OutputFormat
- type OutputFormatter
- func (f *OutputFormatter) Box(title, content string)
- func (f *OutputFormatter) Color(text, color string) string
- func (f *OutputFormatter) DisableColor()
- func (f *OutputFormatter) Error(message string, args ...interface{})
- func (f *OutputFormatter) Header(text string)
- func (f *OutputFormatter) Info(message string, args ...interface{})
- func (f *OutputFormatter) KeyValue(key, value string)
- func (f *OutputFormatter) KeyValueList(items map[string]string)
- func (f *OutputFormatter) List(items []string)
- func (f *OutputFormatter) NumberedList(items []string)
- func (f *OutputFormatter) ProgressBar(current, total int, width int)
- func (f *OutputFormatter) Section(text string)
- func (f *OutputFormatter) SetFormat(format OutputFormat)
- func (f *OutputFormatter) StatusIcon(status string) string
- func (f *OutputFormatter) Success(message string, args ...interface{})
- func (f *OutputFormatter) Table(headers []string, rows [][]string)
- func (f *OutputFormatter) Tree(root TreeNode)
- func (f *OutputFormatter) Warning(message string, args ...interface{})
- type ProgressIndicator
- type Prompt
- func (p *Prompt) Confirm(message string, defaultYes bool) bool
- func (p *Prompt) ConfirmDangerous(operation string, resources []string) bool
- func (p *Prompt) ConfirmWithDetails(message string, details []string) bool
- func (p *Prompt) Input(message string, defaultValue string) (string, error)
- func (p *Prompt) MultiSelect(message string, options []string) ([]int, error)
- func (p *Prompt) Password(message string) (string, error)
- func (p *Prompt) Select(message string, options []string) (int, error)
- func (p *Prompt) SelectWithFilter(message string, options []string) (int, error)
- func (p *Prompt) TableSelect(message string, headers []string, rows [][]string) (int, error)
- type SimpleTreeNode
- type Spinner
- type TreeNode
Constants ¶
const ( ColorReset = "\033[0m" ColorRed = "\033[31m" ColorGreen = "\033[32m" ColorYellow = "\033[33m" ColorBlue = "\033[34m" ColorPurple = "\033[35m" ColorCyan = "\033[36m" ColorWhite = "\033[37m" ColorGray = "\033[90m" ColorBold = "\033[1m" ColorUnderline = "\033[4m" )
Color codes for terminal output
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiProgress ¶
type MultiProgress struct {
// contains filtered or unexported fields
}
MultiProgress manages multiple progress indicators
func NewMultiProgress ¶
func NewMultiProgress() *MultiProgress
NewMultiProgress creates a new multi-progress manager
func (*MultiProgress) AddProgress ¶
func (m *MultiProgress) AddProgress(total int, message string) *ProgressIndicator
AddProgress adds a progress indicator
func (*MultiProgress) AddSpinner ¶
func (m *MultiProgress) AddSpinner(message string) *Spinner
AddSpinner adds a spinner
func (*MultiProgress) StopAll ¶
func (m *MultiProgress) StopAll()
StopAll stops all progress indicators and spinners
type OutputFormat ¶
type OutputFormat string
OutputFormat defines the output format type
const ( FormatTable OutputFormat = "table" FormatJSON OutputFormat = "json" FormatYAML OutputFormat = "yaml" FormatTree OutputFormat = "tree" FormatPlain OutputFormat = "plain" )
type OutputFormatter ¶
type OutputFormatter struct {
// contains filtered or unexported fields
}
OutputFormatter handles formatted output
func NewOutputFormatter ¶
func NewOutputFormatter() *OutputFormatter
NewOutputFormatter creates a new output formatter
func (*OutputFormatter) Box ¶
func (f *OutputFormatter) Box(title, content string)
Box prints text in a box
func (*OutputFormatter) Color ¶
func (f *OutputFormatter) Color(text, color string) string
Color returns colored string if color is enabled
func (*OutputFormatter) DisableColor ¶
func (f *OutputFormatter) DisableColor()
DisableColor disables colored output
func (*OutputFormatter) Error ¶
func (f *OutputFormatter) Error(message string, args ...interface{})
Error prints an error message
func (*OutputFormatter) Header ¶
func (f *OutputFormatter) Header(text string)
Header prints a header
func (*OutputFormatter) Info ¶
func (f *OutputFormatter) Info(message string, args ...interface{})
Info prints an info message
func (*OutputFormatter) KeyValue ¶
func (f *OutputFormatter) KeyValue(key, value string)
KeyValue prints a key-value pair
func (*OutputFormatter) KeyValueList ¶
func (f *OutputFormatter) KeyValueList(items map[string]string)
KeyValueList prints a list of key-value pairs
func (*OutputFormatter) List ¶
func (f *OutputFormatter) List(items []string)
List prints a list with bullets
func (*OutputFormatter) NumberedList ¶
func (f *OutputFormatter) NumberedList(items []string)
NumberedList prints a numbered list
func (*OutputFormatter) ProgressBar ¶
func (f *OutputFormatter) ProgressBar(current, total int, width int)
ProgressBar prints a simple progress bar
func (*OutputFormatter) Section ¶
func (f *OutputFormatter) Section(text string)
Section prints a section header
func (*OutputFormatter) SetFormat ¶
func (f *OutputFormatter) SetFormat(format OutputFormat)
SetFormat sets the output format
func (*OutputFormatter) StatusIcon ¶
func (f *OutputFormatter) StatusIcon(status string) string
StatusIcon returns an appropriate status icon
func (*OutputFormatter) Success ¶
func (f *OutputFormatter) Success(message string, args ...interface{})
Success prints a success message
func (*OutputFormatter) Table ¶
func (f *OutputFormatter) Table(headers []string, rows [][]string)
Table prints data in table format
func (*OutputFormatter) Tree ¶
func (f *OutputFormatter) Tree(root TreeNode)
Tree prints data in tree format
func (*OutputFormatter) Warning ¶
func (f *OutputFormatter) Warning(message string, args ...interface{})
Warning prints a warning message
type ProgressIndicator ¶
type ProgressIndicator struct {
// contains filtered or unexported fields
}
ProgressIndicator provides visual feedback during long-running operations
func NewProgressIndicator ¶
func NewProgressIndicator(total int, message string) *ProgressIndicator
NewProgressIndicator creates a new progress indicator
func (*ProgressIndicator) Complete ¶
func (p *ProgressIndicator) Complete()
Complete marks the progress as complete
func (*ProgressIndicator) Increment ¶
func (p *ProgressIndicator) Increment()
Increment increments the progress by 1
func (*ProgressIndicator) SetMessage ¶
func (p *ProgressIndicator) SetMessage(message string)
SetMessage updates the progress message
func (*ProgressIndicator) Start ¶
func (p *ProgressIndicator) Start()
Start begins the progress display
func (*ProgressIndicator) Update ¶
func (p *ProgressIndicator) Update(current int)
Update updates the current progress
type Prompt ¶
type Prompt struct {
// contains filtered or unexported fields
}
Prompt provides interactive prompting capabilities
func (*Prompt) ConfirmDangerous ¶
ConfirmDangerous asks for confirmation of dangerous operations
func (*Prompt) ConfirmWithDetails ¶
ConfirmWithDetails asks for confirmation with additional details
func (*Prompt) MultiSelect ¶
MultiSelect asks the user to select multiple options
func (*Prompt) SelectWithFilter ¶
SelectWithFilter allows filtering of options
type SimpleTreeNode ¶
SimpleTreeNode is a basic implementation of TreeNode
func (SimpleTreeNode) GetChildren ¶
func (n SimpleTreeNode) GetChildren() []TreeNode
func (SimpleTreeNode) GetName ¶
func (n SimpleTreeNode) GetName() string