ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ui provides terminal output: colors, logging, logos, and welcome screens.

Index

Constants

This section is empty.

Variables

View Source
var (
	Red     = "\033[0;31m"
	Green   = "\033[0;32m"
	Yellow  = "\033[0;33m"
	Blue    = "\033[0;34m"
	Magenta = "\033[0;35m"
	Cyan    = "\033[0;36m"
	White   = "\033[0;37m"
	Bold    = "\033[1m"
	Dim     = "\033[2m"
	NC      = "\033[0m" // No Color / Reset
)

ANSI color codes.

View Source
var Verbose bool

Verbose controls whether debug messages are printed.

Functions

func Cecho

func Cecho(msg, color string)

Cecho prints colored text to stdout.

func Debug

func Debug(msg string)

Debug prints a debug message to stderr (only when Verbose is true).

func Debugf

func Debugf(format string, a ...any)

Debugf prints a formatted debug message to stderr.

func Error

func Error(msg string)

Error prints an error message to stderr and exits with code 1.

func ErrorNoExit

func ErrorNoExit(msg string)

ErrorNoExit prints an error message to stderr without exiting.

func Errorf

func Errorf(format string, a ...any)

Errorf prints a formatted error message to stderr and exits with code 1.

func Info

func Info(msg string)

Info prints an informational message to stdout.

func Infof

func Infof(format string, a ...any)

Infof prints a formatted informational message to stdout.

func Logo()

Logo prints the full ExitBox logo with tagline.

func LogoSmall

func LogoSmall()

LogoSmall prints the ExitBox ASCII logo.

func Success

func Success(msg string)

Success prints a success message to stdout.

func Successf

func Successf(format string, a ...any)

Successf prints a formatted success message to stdout.

func Warn

func Warn(msg string)

Warn prints a warning message to stderr.

func Warnf

func Warnf(format string, a ...any)

Warnf prints a formatted warning message to stderr.

Types

type Spinner added in v0.1.1

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

Spinner displays an animated spinner with a message and elapsed time.

func NewSpinner added in v0.1.1

func NewSpinner(msg string) *Spinner

NewSpinner creates a new spinner with the given message.

func (*Spinner) Start added in v0.1.1

func (s *Spinner) Start()

Start begins the spinner animation in a goroutine.

func (*Spinner) Stop added in v0.1.1

func (s *Spinner) Stop() time.Duration

Stop halts the spinner, clears the line, and returns the elapsed duration.

Jump to

Keyboard shortcuts

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