Documentation
¶
Index ¶
- type DotProgress
- type Message
- func (u *Message) Compact() *Message
- func (u *Message) Do()
- func (u *Message) Msg(message string)
- func (u *Message) Msgf(message string, a ...interface{})
- func (u *Message) NoNewline() *Message
- func (u *Message) WithAskBool(name string, result *bool) *Message
- func (u *Message) WithAskBoolMap(name string, result *bool, answerMap map[string]bool) *Message
- func (u *Message) WithAskInt(name string, result *int64, allowedValues ...int) *Message
- func (u *Message) WithAskPassword(name string, stdin bool, result *string) *Message
- func (u *Message) WithAskString(name string, result *string) *Message
- func (u *Message) WithBoolValue(name string, value bool) *Message
- func (u *Message) WithEnd(code int) *Message
- func (u *Message) WithErr(err error) *Message
- func (u *Message) WithIntValue(name string, value int64) *Message
- func (u *Message) WithStacks() *Message
- func (u *Message) WithStringValue(name string, value string) *Message
- func (u *Message) WithTable(headers ...string) *Message
- func (u *Message) WithTableNoAutoWrapText() *Message
- func (u *Message) WithTableRow(values ...string) *Message
- type Progress
- type UI
- func (u *UI) Err() io.Writer
- func (u *UI) Exclamation() *Message
- func (u *UI) Input() io.Reader
- func (u *UI) Normal() *Message
- func (u *UI) Note() *Message
- func (u *UI) Output() io.Writer
- func (u *UI) Problem() *Message
- func (u *UI) Progress(message string) Progress
- func (u *UI) ProgressNote() *Message
- func (u *UI) Progressf(message string, a ...interface{}) Progress
- func (u *UI) Success() *Message
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DotProgress ¶
type DotProgress struct { Delay time.Duration // Delay is the speed of the indicator // contains filtered or unexported fields }
DotProgress implements a progress indicator by printing a series of dots as time goes by.
func NewDotProgress ¶
func NewDotProgress(ui *UI, message string) *DotProgress
NewDotProgress creates a new DotProgress
func (*DotProgress) ChangeMessage ¶
func (p *DotProgress) ChangeMessage(message string)
ChangeMessage extends the dot-based progress with the ability to change the message mid-flight
func (*DotProgress) ChangeMessagef ¶
func (p *DotProgress) ChangeMessagef(message string, a ...interface{})
ChangeMessagef extends the dot-based progress with the ability to change the message mid-flight
func (*DotProgress) Stop ¶
func (p *DotProgress) Stop()
Stop stops displaying the dot progress spinner
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message represents a piece of information we want displayed to the user
func (*Message) WithAskBool ¶
WithAskBool waits for the user's input for a boolean value
func (*Message) WithAskBoolMap ¶ added in v0.1.5
WithAskBool waits for the user's input for a boolean value
func (*Message) WithAskInt ¶
WithAskInt waits for the user's input for an int value
func (*Message) WithAskPassword ¶ added in v0.1.7
WithAskPassword waits for the user's input for a password value
func (*Message) WithAskString ¶
WithAskString waits for the user's input for a string value
func (*Message) WithBoolValue ¶
WithBoolValue adds a bool value to be printed in the message
func (*Message) WithIntValue ¶
WithIntValue adds an int value to be printed in the message
func (*Message) WithStacks ¶ added in v0.1.2
WithStack causes error stacks to be printed.
func (*Message) WithStringValue ¶
WithStringValue adds a string value to be printed in the message
func (*Message) WithTableNoAutoWrapText ¶ added in v0.8.1
func (*Message) WithTableRow ¶
WithTableRow adds a row in the latest table
type Progress ¶
type Progress interface { Start() Stop() ChangeMessage(message string) ChangeMessagef(message string, a ...interface{}) }
Progress abstracts the operations for a progress meter and/or spinner used to indicate the cli waiting for some background operation to complete.
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
UI contains functionality for dealing with the user on the CLI
func NewUIWithOutput ¶
NewUI creates a new UI with a specific output
func NewUIWithOutputErrorAndInput ¶ added in v0.1.9
NewUI creates a new UI with a specific input, error output and output
func (*UI) Exclamation ¶
Exclamation returns a UIMessage that prints an exclamation message
func (*UI) Progress ¶
Progress creates, configures, and returns an active progress meter. It accepts a fixed message.
func (*UI) ProgressNote ¶
ProgressNote returns a UIMessage that prints a progress-related message