Documentation
¶
Index ¶
- Variables
- func AskConfirmation(question string) bool
- func EditCommitMessage(initialMessage string, editorErrorMsg string) (string, error)
- func PrintDuration(msg string, duration time.Duration)
- func PrintError(msg string)
- func PrintErrorWithSuggestion(errMsg, suggestion string)
- func PrintInfo(msg string)
- func PrintKeyValue(key, value string)
- func PrintSectionBanner(title string)
- func PrintSuccess(msg string)
- func PrintWarning(msg string)
- func ShowDiff(files []string) error
- func ShowDiffStats(files []string, headerMessage string) error
- func ShowFilesTree(files []string, headerMessage string) error
- func WithSpinner(message string, fn func() error) error
- func WithSpinnerAndDuration(message string, fn func() error) error
- type FileChange
- type SmartSpinner
- type SpinnerBuilder
- func (b *SpinnerBuilder) Build() *SmartSpinner
- func (b *SpinnerBuilder) WithCharset(charset int) *SpinnerBuilder
- func (b *SpinnerBuilder) WithColor(color string) *SpinnerBuilder
- func (b *SpinnerBuilder) WithMessage(msg string) *SpinnerBuilder
- func (b *SpinnerBuilder) WithSpeed(speed time.Duration) *SpinnerBuilder
Constants ¶
This section is empty.
Variables ¶
var ( // Colores para diferentes tipos de mensajes Success = color.New(color.FgGreen, color.Bold) Error = color.New(color.FgRed, color.Bold) Warning = color.New(color.FgYellow, color.Bold) Info = color.New(color.FgCyan, color.Bold) Accent = color.New(color.FgMagenta, color.Bold) Dim = color.New(color.FgHiBlack) // Emojis con colores SuccessEmoji = Success.Sprint("✓") ErrorEmoji = Error.Sprint("✗") WarningEmoji = Warning.Sprint("⚠") InfoEmoji = Info.Sprint("*") RocketEmoji = Accent.Sprint("🚀") StatsEmoji = Accent.Sprint("📊") )
Functions ¶
func AskConfirmation ¶
func EditCommitMessage ¶
EditCommitMessage abre un editor para que el usuario edite el mensaje
func PrintDuration ¶
func PrintError ¶
func PrintError(msg string)
func PrintErrorWithSuggestion ¶
func PrintErrorWithSuggestion(errMsg, suggestion string)
func PrintKeyValue ¶
func PrintKeyValue(key, value string)
func PrintSectionBanner ¶
func PrintSectionBanner(title string)
func PrintSuccess ¶
func PrintSuccess(msg string)
func PrintWarning ¶
func PrintWarning(msg string)
func ShowDiffStats ¶
ShowDiffStats muestra estadísticas de cambios (como git diff --stat)
func ShowFilesTree ¶
ShowFilesTree muestra los archivos modificados en formato árbol
func WithSpinner ¶
func WithSpinnerAndDuration ¶
Types ¶
type FileChange ¶
FileChange representa un archivo modificado con sus estadísticas
type SmartSpinner ¶
type SmartSpinner struct {
// contains filtered or unexported fields
}
SmartSpinner es un spinner con capacidades mejoradas
func NewSmartSpinner ¶
func NewSmartSpinner(initialMessage string) *SmartSpinner
NewSmartSpinner crea un nuevo spinner con mensaje inicial
func (*SmartSpinner) Error ¶
func (s *SmartSpinner) Error(msg string)
func (*SmartSpinner) Log ¶
func (s *SmartSpinner) Log(msg string)
func (*SmartSpinner) Start ¶
func (s *SmartSpinner) Start()
func (*SmartSpinner) Stop ¶
func (s *SmartSpinner) Stop()
func (*SmartSpinner) Success ¶
func (s *SmartSpinner) Success(msg string)
func (*SmartSpinner) UpdateMessage ¶
func (s *SmartSpinner) UpdateMessage(msg string)
func (*SmartSpinner) Warning ¶
func (s *SmartSpinner) Warning(msg string)
type SpinnerBuilder ¶
type SpinnerBuilder struct {
// contains filtered or unexported fields
}
SpinnerBuilder permite construir spinners con configuración flexible
func (*SpinnerBuilder) Build ¶
func (b *SpinnerBuilder) Build() *SmartSpinner
Build construye el SmartSpinner con la configuración especificada
func (*SpinnerBuilder) WithCharset ¶
func (b *SpinnerBuilder) WithCharset(charset int) *SpinnerBuilder
WithCharset establece el charset del spinner
func (*SpinnerBuilder) WithColor ¶
func (b *SpinnerBuilder) WithColor(color string) *SpinnerBuilder
WithColor establece el color del spinner
func (*SpinnerBuilder) WithMessage ¶
func (b *SpinnerBuilder) WithMessage(msg string) *SpinnerBuilder
WithMessage establece el mensaje del spinner
func (*SpinnerBuilder) WithSpeed ¶
func (b *SpinnerBuilder) WithSpeed(speed time.Duration) *SpinnerBuilder
WithSpeed establece la velocidad del spinner