ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorReset  = "\033[0m"
	ColorGreen  = "\033[32m" // Success
	ColorRed    = "\033[31m" // Errors
	ColorBlue   = "\033[34m" // Info
	ColorYellow = "\033[33m" // Warnings
	ColorCyan   = "\033[36m" // Highlights
	ColorGray   = "\033[90m" // Muted text
)

ANSI Color Constants

View Source
const (
	FormatBold      = "\033[1m"
	FormatDim       = "\033[2m"
	FormatItalic    = "\033[3m"
	FormatUnderline = "\033[4m"

	// Specific reset codes (don't reset colors)
	ResetBoldDim   = "\033[22m" // Reset bold and dim
	ResetItalic    = "\033[23m" // Reset italic
	ResetUnderline = "\033[24m" // Reset underline
)

ANSI Text Formatting Constants

View Source
const (
	EmojiStart   = "✨"
	EmojiStop    = "🛑"
	EmojiStatus  = "⏱️"
	EmojiStats   = "📊"
	EmojiLog     = "📝"
	EmojiManual  = "✍️"
	EmojiInit    = "⚙️"
	EmojiExport  = "📤"
	EmojiSuccess = "✅"
	EmojiError   = "❌"
	EmojiWarning = "⚠️"
	EmojiInfo    = "ℹ️"
)

Emoji Constants

Variables

This section is empty.

Functions

func Bold

func Bold(message string) string

Bold text formatting functions that return formatted string

func BoldError

func BoldError(message string) string

Bold error combined formatting functions for common use cases

func BoldInfo

func BoldInfo(message string) string

Bold info combined formatting functions for common use cases

func BoldSuccess

func BoldSuccess(message string) string

Bold success combined formatting functions for common use cases

func BoldWarning

func BoldWarning(message string) string

Bold warning combined formatting functions for common use cases

func Dim

func Dim(message string) string

Dim text formatting functions that return formatted string

func Error

func Error(message string) string

Error colored output functions that returns colored string

func FormatDuration

func FormatDuration(d time.Duration) string

FormatDuration formats d into a concise, human-readable string using hours, minutes and seconds. It returns "<h>h <m>m <s>s" when the duration is at least one hour, "<m>m <s>s" when the duration is at least one minute but less than an hour, and "<s>s" for durations under one minute. Hours, minutes and seconds are derived from d using integer truncation (no fractional parts). This function is intended for non-negative durations; behavior for negative durations is unspecified.

func Info

func Info(message string) string

Info colored output functions that returns colored string

func Italic

func Italic(message string) string

Italic text formatting functions that return formatted string

func Muted

func Muted(message string) string

Muted colored output functions that returns colored string

func NewlineAbove

func NewlineAbove()

NewlineAbove prints a single newline before output This creates visual separation from the user's command input

func NewlineBelow

func NewlineBelow()

NewlineBelow prints a single newline after output

func PrintError

func PrintError(emoji, message string)

PrintError prints an error message with emoji and color to stderr

func PrintInfo

func PrintInfo(indent int, label, value string)

PrintInfo prints an info line with proper indentation and color indent specifies the number of spaces (typically 4 or 8) If value is empty, only label is printed

func PrintMuted

func PrintMuted(indent int, message string)

PrintMuted prints muted (gray) text with optional indentation

func PrintSeparator

func PrintSeparator()

PrintSeparator prints a subtle horizontal separator line

func PrintSuccess

func PrintSuccess(emoji, message string)

PrintSuccess prints a success message with emoji and color to stdout

func PrintWarning

func PrintWarning(emoji, message string)

PrintWarning prints a warning message with emoji and color to stdout

func Success

func Success(message string) string

Success colored output functions that returns colored string

func Underline

func Underline(message string) string

Underline text formatting functions that return formatted string

func Warning

func Warning(message string) string

Warning colored output functions that returns colored string

Types

This section is empty.

Jump to

Keyboard shortcuts

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