ui

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Bold   = lipgloss.NewStyle().Bold(true)
	Faint  = lipgloss.NewStyle().Faint(true)
	Green  = lipgloss.NewStyle().Foreground(lipgloss.Color("2"))
	Red    = lipgloss.NewStyle().Foreground(lipgloss.Color("1"))
	Yellow = lipgloss.NewStyle().Foreground(lipgloss.Color("3"))
	Orange = lipgloss.NewStyle().Foreground(lipgloss.Color("208"))
	Cyan   = lipgloss.NewStyle().Foreground(lipgloss.Color("6"))

	IconPass = Green.Render("✅")
	IconFail = Red.Render("❌")
	IconWarn = Yellow.Render("⚠️")
	IconSkip = Faint.Render("⏭")
	IconInfo = Cyan.Render("ℹ")
)

Functions

func Banner(title string)

func Fail

func Fail(name, detail string)

func Info

func Info(msg string)

func Logf

func Logf(format string, args ...any)

func Section

func Section(title string)

func Skip

func Skip(name, detail string)

func Success

func Success(name, detail string)

func Summary

func Summary(pass, warn, fail, skipped int)

func Warn

func Warn(name, detail string)

func WithSpinner

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

WithSpinner runs fn while showing an animated spinner with msg. The spinner is stopped before fn returns so that fn's own stdout output (if any) is not garbled.

Types

type Spinner

type Spinner struct {
	// contains filtered or unexported fields
}

Spinner provides an animated terminal spinner that works alongside normal stdout output. It is safe for non-TTY environments (becomes a no-op).

func NewSpinner

func NewSpinner() *Spinner

func (*Spinner) Start

func (s *Spinner) Start(msg string)

Start begins the spinner animation with the given message. If a spinner is already active it is stopped first.

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop halts the spinner and clears its line.

func (*Spinner) Update

func (s *Spinner) Update(msg string)

Update changes the spinner message while it is running.

Jump to

Keyboard shortcuts

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