ui

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 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 added in v1.6.0

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 added in v1.6.0

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 added in v1.6.0

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

func (*WriterUI) AskSecret added in v1.6.0

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

func (*WriterUI) Error added in v1.6.0

func (w *WriterUI) Error(message string)

func (*WriterUI) ErrorWriter added in v1.6.0

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

func (*WriterUI) Info added in v1.6.0

func (w *WriterUI) Info(message string)

func (*WriterUI) InputReader added in v1.6.0

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

func (*WriterUI) Output added in v1.6.0

func (w *WriterUI) Output(message string)

func (*WriterUI) OutputWriter added in v1.6.0

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

func (*WriterUI) Warn added in v1.6.0

func (w *WriterUI) Warn(message string)

Jump to

Keyboard shortcuts

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