ui

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Red    = "\033[0;31m"
	Green  = "\033[0;32m"
	Yellow = "\033[1;33m"
	Blue   = "\033[0;34m"
	Cyan   = "\033[0;36m"
	Bold   = "\033[1m"
	Dim    = "\033[2m"
	Reset  = "\033[0m"
)

ANSI color codes

Variables

View Source
var DebugEnabled bool

Functions

func Banner(title string)

Banner prints a bordered title section.

func BlueText

func BlueText(s string) string

func BoldText

func BoldText(s string) string

func CyanText

func CyanText(s string) string

func DimText

func DimText(s string) string

func FormatDuration

func FormatDuration(seconds int) string

FormatDuration formats seconds into a human-readable duration.

func FormatSize

func FormatSize(bytes int64) string

FormatSize formats bytes into human-readable size.

func GreenText

func GreenText(s string) string

func Hint

func Hint(msg string)

Hint prints a dim hint line.

func LogDebug

func LogDebug(msg string)

func LogError

func LogError(msg string)

func LogInfo

func LogInfo(msg string)

func LogSuccess

func LogSuccess(msg string)

func LogWarn

func LogWarn(msg string)

func PrintKeyValue

func PrintKeyValue(key, value string)

PrintKeyValue prints a key-value pair with dim key.

func RedText

func RedText(s string) string

func SectionHeader

func SectionHeader(title string)

SectionHeader prints a bold section header with a separator line.

func Separator

func Separator()

Separator prints a horizontal rule.

func SetColorsEnabled

func SetColorsEnabled(enabled bool)

SetColorsEnabled controls whether ANSI codes are emitted.

func ShortenHome

func ShortenHome(path, home string) string

ShortenHome replaces the home directory prefix with ~.

func Truncate

func Truncate(s string, max int) string

Truncate shortens a string to max length with ellipsis.

func YellowText

func YellowText(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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