ui

package
v1.6.112 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogUI

func NewLogUI(ui cli.Ui) (cli.Ui, error)

NewLogUI generates a new cli.Ui that can be used for commands that write log lines to the terminal. The caller is required to pass a cli.BasicUi so we have access to the underlying writers.

Currently, the passed ui needs to be either *cli.ColoredUi or *cli.BasicUi to work correctly. If more are needed, please add them.

Types

type LogUI

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

LogUI is an implementation of the cli.Ui interface which can be used for logging outputs. It differs from cli.BasicUi in the only fact that it does not add a newline after each UI write.

func (*LogUI) Ask

func (l *LogUI) Ask(query string) (string, error)

Ask implements the Ask function of the cli.Ui interface.

func (*LogUI) AskSecret

func (l *LogUI) AskSecret(query string) (string, error)

AskSecret implements the AskSecret function of the cli.Ui interface.

func (*LogUI) Error

func (l *LogUI) Error(message string)

Error implements the Error function of the cli.Ui interface.

func (*LogUI) Info

func (l *LogUI) Info(message string)

Info implements the Info function of the cli.Ui interface.

func (*LogUI) Output

func (l *LogUI) Output(message string)

Output implements the Output function of the cli.Ui interface.

func (*LogUI) Warn

func (l *LogUI) Warn(message string)

Warn implements the Warn function of the cli.Ui interface.

type WriterUI

type WriterUI struct {
	// Ui is the wrapped cli.Ui that supplies the functions for the thin shims
	Ui cli.Ui
	// contains filtered or unexported fields
}

WriterUI is an implementation of the cli.Ui interface which can be used for commands that need to have direct access to the underlying UI readers and writers.

func NewWriterUI

func NewWriterUI(ui cli.Ui) (*WriterUI, error)

NewWriterUI generates a new cli.Ui that can be used for commands that need access to the underlying UI's writers for copying large amounts of data without local buffering. The caller is required to pass a UI chain ending in a cli.BasicUi (or a cli.MockUi for testing).

Currently, the UIs in the chain need to be pointers to a cli.ColoredUi, cli.BasicUi, or cli.MockUi to work correctly.

func (*WriterUI) Ask

func (w *WriterUI) Ask(query string) (string, error)

func (*WriterUI) AskSecret

func (w *WriterUI) AskSecret(query string) (string, error)

func (*WriterUI) Error

func (w *WriterUI) Error(message string)

func (*WriterUI) ErrorWriter

func (w *WriterUI) ErrorWriter() io.Writer

func (*WriterUI) Info

func (w *WriterUI) Info(message string)

func (*WriterUI) InputReader

func (w *WriterUI) InputReader() io.Reader

func (*WriterUI) Output

func (w *WriterUI) Output(message string)

func (*WriterUI) OutputWriter

func (w *WriterUI) OutputWriter() io.Writer

func (*WriterUI) Warn

func (w *WriterUI) Warn(message string)

Jump to

Keyboard shortcuts

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