ui

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ui degrades to plain text when output is not a terminal or color is disabled.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Age

func Age(t time.Time) string

func Bold

func Bold(s string) string

func Confirm

func Confirm(prompt string) bool

Confirm returns false off a TTY, so non-interactive callers must pass --yes.

func Cyan

func Cyan(s string) string

func Detail

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

func Dim

func Dim(s string) string

func Fail

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

func Green

func Green(s string) string

func Info

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

func IsTerminal

func IsTerminal() bool

func Magenta

func Magenta(s string) string

func Red

func Red(s string) string

func SetColor

func SetColor(on bool)

SetColor overrides auto-detection, but color is still only honored on a TTY.

func Status

func Status(s string) string

func Success

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

func Warn

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

func Yellow

func Yellow(s string) string

Types

type Spinner

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

Spinner renders nothing off a TTY; callers' plain status lines carry the information there.

func NewSpinner

func NewSpinner(msg string) *Spinner

func (*Spinner) Start

func (s *Spinner) Start()

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop is safe to call more than once.

func (*Spinner) Update

func (s *Spinner) Update(msg string)

type Table

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

func NewTable

func NewTable(headers ...string) *Table

func (*Table) Print

func (t *Table) Print()

func (*Table) Render

func (t *Table) Render(w io.Writer)

func (*Table) Row

func (t *Table) Row(cells ...any)

Jump to

Keyboard shortcuts

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