ui

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCancelled = errors.New("cancelled")

ErrCancelled is returned by prompts when the user aborts (Ctrl+C / Esc). Callers should treat it as a clean, non-error cancellation.

Functions

func Box

func Box(content string)

Box prints content in a box on stdout (used for primary command output).

func Error

func Error(message string)

Error prints an error message.

func FormatDuration

func FormatDuration(d time.Duration) string

FormatDuration formats a duration in a human-readable way.

func Info

func Info(message string)

Info prints an info message.

func IsInteractive added in v0.4.0

func IsInteractive() bool

IsInteractive reports whether we can prompt the user: stdin must be a terminal (for input) and stderr must be a terminal (where prompts render).

func PrintContainerInfo

func PrintContainerInfo(c *database.Container)

PrintContainerInfo prints detailed container information.

func PromptConfirm

func PromptConfirm(label string, defaultValue bool) (bool, error)

PromptConfirm prompts the user for confirmation. When not interactive it returns defaultValue without prompting.

func PromptString

func PromptString(label string, defaultValue string) (string, error)

PromptString prompts the user for a string input.

func SelectContainer

func SelectContainer(containers []*database.Container, label string) (*database.Container, error)

SelectContainer prompts the user to select a container.

func SelectDBType

func SelectDBType() (string, error)

SelectDBType prompts the user to select a database type.

func SelectUser

func SelectUser(users []*database.User, label string) (*database.User, error)

SelectUser prompts the user to select a user.

func SelectVolumeOption

func SelectVolumeOption() (string, error)

SelectVolumeOption prompts the user to select a volume option.

func Success

func Success(message string)

Success prints a success message.

func Warning

func Warning(message string)

Warning prints a warning message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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