Documentation
¶
Index ¶
- Variables
- func Box(content string)
- func Error(message string)
- func FormatDuration(d time.Duration) string
- func Info(message string)
- func IsInteractive() bool
- func PrintContainerInfo(c *database.Container)
- func PromptConfirm(label string, defaultValue bool) (bool, error)
- func PromptString(label string, defaultValue string) (string, error)
- func SelectContainer(containers []*database.Container, label string) (*database.Container, error)
- func SelectDBType() (string, error)
- func SelectUser(users []*database.User, label string) (*database.User, error)
- func SelectVolumeOption() (string, error)
- func Success(message string)
- func Warning(message string)
Constants ¶
This section is empty.
Variables ¶
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 FormatDuration ¶
FormatDuration formats a duration in a human-readable way.
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 ¶
PrintContainerInfo prints detailed container information.
func PromptConfirm ¶
PromptConfirm prompts the user for confirmation. When not interactive it returns defaultValue without prompting.
func PromptString ¶
PromptString prompts the user for a string input.
func SelectContainer ¶
SelectContainer prompts the user to select a container.
func SelectDBType ¶
SelectDBType prompts the user to select a database type.
func SelectUser ¶
SelectUser prompts the user to select a user.
func SelectVolumeOption ¶
SelectVolumeOption prompts the user to select a volume option.
Types ¶
This section is empty.