Documentation ¶
Index ¶
- func NewLogUI(ui cli.Ui) (cli.Ui, error)
- type LogUI
- type WriterUI
- func (w *WriterUI) Ask(query string) (string, error)
- func (w *WriterUI) AskSecret(query string) (string, error)
- func (w *WriterUI) Error(message string)
- func (w *WriterUI) ErrorWriter() io.Writer
- func (w *WriterUI) Info(message string)
- func (w *WriterUI) InputReader() io.Reader
- func (w *WriterUI) Output(message string)
- func (w *WriterUI) OutputWriter() io.Writer
- func (w *WriterUI) Warn(message string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLogUI ¶
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.
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
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.