Documentation
¶
Overview ¶
package ui was taken from Packer - https://github.com/mitchellh/packer/blob/master/packer/ui.go
Index ¶
Constants ¶
const ( UiColorRed UiColor = 31 UiColorGreen = 32 UiColorYellow = 33 UiColorBlue = 34 UiColorMagenta = 35 UiColorCyan = 36 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicUi ¶
type BasicUi struct { Reader io.Reader Writer io.Writer ErrorWriter io.Writer // contains filtered or unexported fields }
The BasicUI is a UI that reads and writes from a standard Go reader and writer. It is safe to be called from multiple goroutines. Machine readable output is simply logged for this UI.
type MachineReadableUi ¶
MachineReadableUi is a UI that only outputs machine-readable output to the given Writer.
func (*MachineReadableUi) Error ¶
func (u *MachineReadableUi) Error(message string)
func (*MachineReadableUi) Machine ¶
func (u *MachineReadableUi) Machine(category string, args ...string)
func (*MachineReadableUi) Message ¶
func (u *MachineReadableUi) Message(message string)
func (*MachineReadableUi) Say ¶
func (u *MachineReadableUi) Say(message string)
type TargettedUi ¶
TargettedUi is a UI that wraps another UI implementation and modifies the output to indicate a specific target. Specifically, all Say output is prefixed with the target name. Message output is not prefixed but is offset by the length of the target so that output is lined up properly with Say output. Machine-readable output has the proper target set.
func (*TargettedUi) Error ¶
func (u *TargettedUi) Error(message string)
func (*TargettedUi) Machine ¶
func (u *TargettedUi) Machine(t string, args ...string)
func (*TargettedUi) Message ¶
func (u *TargettedUi) Message(message string)
func (*TargettedUi) Say ¶
func (u *TargettedUi) Say(message string)
type Ui ¶
type Ui interface { Ask(string) (string, error) Say(string) Message(string) Error(string) Machine(string, ...string) }
The Ui interface handles all communication for Packer with the outside world. This sort of control allows us to strictly control how output is formatted and various levels of output.