ui

package
v1.0.0-rc.10 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: EPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatControlPlaneStageLine

func FormatControlPlaneStageLine(stage string) string

FormatControlPlaneStageLine formats control plane deploy apply progress text.

func FormatDeployStageLine

func FormatDeployStageLine(stage string) string

FormatDeployStageLine formats deploy apply progress text for a stage label.

func FormatRuntimeClassStageLine

func FormatRuntimeClassStageLine(stage string) string

FormatRuntimeClassStageLine formats runtimeclass apply progress text.

func IsInteractive

func IsInteractive(w io.Writer, opts Options) bool

IsInteractive reports whether progress/spinner UX should be used for w.

Types

type Options

type Options struct {
	Quiet    bool
	NoColor  bool
	ForceTTY bool
}

Options configures interactive CLI output behavior.

type Spinner

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

Spinner wraps a single stderr spinner tied to this UI instance.

func (*Spinner) SetSuffix

func (s *Spinner) SetSuffix(message string)

SetSuffix updates spinner suffix text.

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop stops this spinner instance.

type UI

type UI struct {
	Out    io.Writer
	ErrOut io.Writer
	// contains filtered or unexported fields
}

UI centralizes CLI user-facing output on stderr and data on stdout.

func New

func New(opts Options) *UI

New creates a UI with TTY detection on stderr.

func NewWithWriters

func NewWithWriters(out, errOut io.Writer, opts Options) *UI

NewWithWriters creates a UI for tests with explicit writers.

func (*UI) ClearProgressLine

func (u *UI) ClearProgressLine()

ClearProgressLine clears the current stderr progress line.

func (*UI) Interactive

func (u *UI) Interactive() bool

Interactive reports whether spinner/progress overwrite mode is active.

func (*UI) PauseSpinner

func (u *UI) PauseSpinner(active *Spinner) bool

PauseSpinner stops the spinner temporarily and returns whether it was running.

func (*UI) StartSpinner

func (u *UI) StartSpinner(message string) *Spinner

StartSpinner begins an interactive spinner or prints a plain line in quiet/non-interactive mode.

func (*UI) StopSpinner

func (u *UI) StopSpinner()

StopSpinner stops the active spinner and clears the progress line.

func (*UI) WriteError

func (u *UI) WriteError(message string)

WriteError prints an error marker on stderr and stops any spinner.

func (*UI) WritePercent

func (u *UI) WritePercent(label string, percent int, done bool)

WritePercent writes a throttled percent progress bar on stderr.

func (*UI) WritePlain

func (u *UI) WritePlain(text string)

WritePlain writes unstyled text to stderr.

func (*UI) WriteStageLine

func (u *UI) WriteStageLine(line string)

WriteStageLine updates deploy-style stage progress on stderr.

func (*UI) WriteSuccess

func (u *UI) WriteSuccess(message string)

WriteSuccess prints a success marker on stderr and stops any spinner.

Jump to

Keyboard shortcuts

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