Documentation
¶
Index ¶
- func ClearLine()
- func Confirm(message string) bool
- func MoveCursorDown(lines int)
- func MoveCursorUp(lines int)
- func PromptMultiSelect(message string, options []string) []string
- func PromptPassword(message string) string
- func PromptSelect(message string, options []string) string
- func PromptSelectIndex(message string, options []string) int
- func PromptString(message string) string
- func PromptStringWithDefault(message, defaultValue string) string
- func ShowProgress(current, total int, message string)
- type ProgressTracker
- func (pt *ProgressTracker) AddStep(id, description string)
- func (pt *ProgressTracker) CompleteStep(id string)
- func (pt *ProgressTracker) FailStep(id, error string)
- func (pt *ProgressTracker) GetSummary() string
- func (pt *ProgressTracker) HasFailed() bool
- func (pt *ProgressTracker) IsCompleted() bool
- func (pt *ProgressTracker) SkipStep(id, reason string)
- func (pt *ProgressTracker) Start()
- func (pt *ProgressTracker) StartStep(id string)
- func (pt *ProgressTracker) Stop()
- type Step
- type StepStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MoveCursorDown ¶
func MoveCursorDown(lines int)
MoveCursorDown moves the cursor down by the specified number of lines
func MoveCursorUp ¶
func MoveCursorUp(lines int)
MoveCursorUp moves the cursor up by the specified number of lines
func PromptMultiSelect ¶
PromptMultiSelect prompts the user to select multiple options
func PromptPassword ¶
PromptPassword prompts the user for a password (input is hidden) Note: This is a basic implementation. For production use, consider using a library like golang.org/x/term for proper password input handling
func PromptSelect ¶
PromptSelect prompts the user to select from a list of options
func PromptSelectIndex ¶
PromptSelectIndex prompts the user to select from a list and returns the index
func PromptString ¶
PromptString prompts the user for a string input
func PromptStringWithDefault ¶
PromptStringWithDefault prompts the user for a string input with a default value
func ShowProgress ¶
ShowProgress displays a simple progress indicator
Types ¶
type ProgressTracker ¶
type ProgressTracker struct {
// contains filtered or unexported fields
}
ProgressTracker tracks progress of multi-step operations
func NewProgressTracker ¶
func NewProgressTracker(title string) *ProgressTracker
NewProgressTracker creates a new progress tracker
func (*ProgressTracker) AddStep ¶
func (pt *ProgressTracker) AddStep(id, description string)
AddStep adds a new step to the tracker
func (*ProgressTracker) CompleteStep ¶
func (pt *ProgressTracker) CompleteStep(id string)
CompleteStep marks a step as completed
func (*ProgressTracker) FailStep ¶
func (pt *ProgressTracker) FailStep(id, error string)
FailStep marks a step as failed
func (*ProgressTracker) GetSummary ¶
func (pt *ProgressTracker) GetSummary() string
GetSummary returns a summary of the progress
func (*ProgressTracker) HasFailed ¶
func (pt *ProgressTracker) HasFailed() bool
HasFailed returns true if any step has failed
func (*ProgressTracker) IsCompleted ¶
func (pt *ProgressTracker) IsCompleted() bool
IsCompleted returns true if all steps are completed or skipped
func (*ProgressTracker) SkipStep ¶
func (pt *ProgressTracker) SkipStep(id, reason string)
SkipStep marks a step as skipped
func (*ProgressTracker) StartStep ¶
func (pt *ProgressTracker) StartStep(id string)
StartStep marks a step as running
type Step ¶
type Step struct {
ID string
Description string
Status StepStatus
Detail string
StartTime time.Time
EndTime time.Time
}
Step represents a single step in a progress tracker
type StepStatus ¶
type StepStatus int
StepStatus represents the status of a step
const ( StepStatusPending StepStatus = iota StepStatusRunning StepStatusCompleted StepStatusSkipped StepStatusFailed )
func (StepStatus) String ¶
func (s StepStatus) String() string
String returns a string representation of the step status