ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ui provides common methods for user interaction on the command line

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

type Table interface {
	Add(row ...string)
	Print()
}

Table provides an interface for displaying tabular information.

func NewTable

func NewTable(ui UI, colorsEnabled bool, headers ...string) Table

NewTable returns a new Table with the given headers that will render to the given UI.

type UI

type UI interface {
	Display(message string, args ...interface{})
	Ask(prompt string, args ...interface{}) (answer string)
	AskForPassword(prompt string, args ...interface{}) (answer string)
	Table(headers []string) Table
	Warn(message string, args ...interface{})
	Error(message string, args ...interface{})
}

UI provides methods for interacting with the user in a terminal.

func NewUI

func NewUI(
	stdin io.Reader,
	stdout io.Writer,
	stderr io.Writer,
) UI

NewUI returns a new UI that will read from the given io.Reader and write to the given io.Writer.

Jump to

Keyboard shortcuts

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