ui

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSONMode bool

JSONMode when true, all styled output functions are no-ops (stdout remains clean for JSON).

Functions

func Accent

func Accent(s string) string

Accent returns an accent-styled string.

func Bold

func Bold(s string) string

Bold returns a bold-styled string.

func Code

func Code(s string) string

Code returns a code-styled string.

func Download

func Download(name, version string)

Download prints a download line to stderr: " ↓ name version"

func Error

func Error(detail ErrorDetail)

Error prints a structured error to stderr. Format:

✗ message

  context

  Try: suggestion

func Errorf

func Errorf(format string, args ...interface{})

Errorf prints a simple formatted error to stderr: " ✗ message"

func Faint

func Faint(s string) string

Faint returns a faint-styled string.

func Info

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

Info prints an informational message to stderr: " · message"

func New

func New(name, version string)

New prints a new-install line to stderr: " + name version (new)"

func PrintJSON

func PrintJSON(v interface{}) error

PrintJSON encodes v to stdout with 2-space indentation.

func PrintJSONError

func PrintJSONError(msg, code, suggestion string)

PrintJSONError prints a structured JSON error object to stdout.

func Success

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

Success prints a success message to stderr: " ✓ message"

func Summary

func Summary(parts ...string)

Summary prints a summary line to stderr: "\n part1 · part2 · part3"

func Warn

func Warn(format string, args ...interface{})

Warn prints a warning message to stderr: " ! message"

Types

type ErrorDetail

type ErrorDetail struct {
	Message    string
	Context    string
	Suggestion string
}

ErrorDetail holds structured error information for display.

Jump to

Keyboard shortcuts

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