ui

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 AskConfirmation(question string) bool

func EditCommitMessage

func EditCommitMessage(initialMessage string, editorErrorMsg string) (string, error)

EditCommitMessage abre un editor para que el usuario edite el mensaje

func PrintDuration

func PrintDuration(msg string, duration time.Duration)

func PrintError

func PrintError(msg string)

func PrintErrorWithSuggestion

func PrintErrorWithSuggestion(errMsg, suggestion string)

func PrintInfo

func PrintInfo(msg 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 ShowDiff

func ShowDiff(files []string) error

func ShowDiffStats

func ShowDiffStats(files []string, headerMessage string) error

ShowDiffStats muestra estadísticas de cambios (como git diff --stat)

func ShowFilesTree

func ShowFilesTree(files []string, headerMessage string) error

ShowFilesTree muestra los archivos modificados en formato árbol

func WithSpinner

func WithSpinner(message string, fn func() error) error

func WithSpinnerAndDuration

func WithSpinnerAndDuration(message string, fn func() error) error

Types

type FileChange

type FileChange struct {
	Path      string
	Additions int
	Deletions int
}

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 NewSpinner

func NewSpinner() *SpinnerBuilder

NewSpinner crea un nuevo builder para spinners

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL