Documentation
¶
Index ¶
- type Bot
- type Config
- type UI
- func (u *UI) FieldTable(tbl *terminal.Table, _ ...terminal.Option)
- func (u *UI) Input(_ *terminal.Input) (string, error)
- func (u *UI) Interactive() bool
- func (u *UI) NamedValues(nvs []terminal.NamedValue, _ ...terminal.Option)
- func (u *UI) Output(str string, _ ...interface{})
- func (u *UI) OutputWriters() (stdout io.Writer, stderr io.Writer, err error)
- func (u *UI) Status() terminal.Status
- func (u *UI) StepGroup() terminal.StepGroup
- func (u *UI) Table(tbl *terminal.Table, opts ...terminal.Option)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UI ¶
type UI struct { L hclog.Logger // contains filtered or unexported fields }
func (*UI) FieldTable ¶
Table outputs the information formatted into a Table structure.
func (*UI) Input ¶
Input asks the user for input. This will immediately return an error if the UI doesn't support interaction. You can test for interaction ahead of time with Interactive().
func (*UI) Interactive ¶
Interactive returns true if this prompt supports user interaction. If this is false, Input will always error.
func (*UI) NamedValues ¶
func (u *UI) NamedValues(nvs []terminal.NamedValue, _ ...terminal.Option)
Output data as a table of data. Each entry is a row which will be output with the columns lined up nicely.
func (*UI) Output ¶
Output outputs a message directly to the terminal. The remaining arguments should be interpolations for the format string. After the interpolations you may add Options.
func (*UI) OutputWriters ¶
OutputWriters returns stdout and stderr writers. These are usually but not always TTYs. This is useful for subprocesses, network requests, etc. Note that writing to these is not thread-safe by default so you must take care that there is only ever one writer.
func (*UI) Status ¶
Status returns a live-updating status that can be used for single-line status updates that typically have a spinner or some similar style. While a Status is live (Close isn't called), other methods on UI should NOT be called.