formatter

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorReset  = "\033[0m"
	ColorRed    = "\033[31m"
	ColorGreen  = "\033[32m"
	ColorYellow = "\033[33m"
	ColorBlue   = "\033[34m"
	ColorPurple = "\033[35m"
	ColorCyan   = "\033[36m"
	ColorGray   = "\033[37m"
	ColorWhite  = "\033[97m"

	ColorBold      = "\033[1m"
	ColorDim       = "\033[2m"
	ColorUnderline = "\033[4m"
)

Color codes for terminal output

View Source
const (
	IconSuccess  = "✓"
	IconError    = "✗"
	IconWarning  = "⚠️"
	IconInfo     = "→"
	IconPackage  = "📦"
	IconTrash    = "🗑️"
	IconTools    = "🔧"
	IconRocket   = "🚀"
	IconClock    = "⏰"
	IconCheck    = "✅"
	IconCross    = "❌"
	IconQuestion = "❓"
)

Icons for different message types

Variables

This section is empty.

Functions

This section is empty.

Types

type Output

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

Output provides formatted output methods

func New

func New(verbose, noColor bool) *Output

New creates a new Output formatter

func (*Output) Bold

func (o *Output) Bold(text string) string

Bold prints bold text

func (*Output) Dim

func (o *Output) Dim(text string) string

Dim prints dimmed text

func (*Output) Divider

func (o *Output) Divider()

Divider prints a visual divider

func (*Output) EmptyLine

func (o *Output) EmptyLine()

EmptyLine prints an empty line

func (*Output) Error

func (o *Output) Error(format string, args ...interface{})

Error prints an error message

func (*Output) Info

func (o *Output) Info(format string, args ...interface{})

Info prints an info message

func (*Output) KeyValue

func (o *Output) KeyValue(key, value string)

KeyValue prints a key-value pair

func (*Output) List

func (o *Output) List(items ...string)

List prints a bulleted list

func (*Output) NumberedList

func (o *Output) NumberedList(items ...string)

NumberedList prints a numbered list

func (*Output) Plain

func (o *Output) Plain(format string, args ...interface{})

Plain prints plain text without formatting

func (*Output) Progress

func (o *Output) Progress(current, total int, format string, args ...interface{})

Progress prints a progress message

func (*Output) Section

func (o *Output) Section(title string)

Section prints a section header

func (*Output) Spinner

func (o *Output) Spinner(format string, args ...interface{})

Spinner prints a spinner message (not animated, just the icon)

func (*Output) Step

func (o *Output) Step(format string, args ...interface{})

Step prints a step message

func (*Output) Subsection

func (o *Output) Subsection(title string)

Subsection prints a subsection header

func (*Output) Success

func (o *Output) Success(format string, args ...interface{})

Success prints a success message

func (*Output) Table

func (o *Output) Table(headers []string, rows [][]string)

Table prints a simple table

func (*Output) Verbose

func (o *Output) Verbose(format string, args ...interface{})

Verbose prints a message only if verbose mode is enabled

func (*Output) Warning

func (o *Output) Warning(format string, args ...interface{})

Warning prints a warning message

Jump to

Keyboard shortcuts

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