Documentation ¶
Index ¶
- type ChoiceOpts
- type ColorUI
- func (ui *ColorUI) AskForChoice(opts ChoiceOpts) (int, error)
- func (ui *ColorUI) AskForConfirmation() error
- func (ui *ColorUI) AskForPassword(label string) (string, error)
- func (ui *ColorUI) AskForText(opts TextOpts) (string, error)
- func (ui *ColorUI) BeginLinef(pattern string, args ...interface{})
- func (ui *ColorUI) EndLinef(pattern string, args ...interface{})
- func (ui *ColorUI) ErrorLinef(pattern string, args ...interface{})
- func (ui *ColorUI) Flush()
- func (ui *ColorUI) IsInteractive() bool
- func (ui *ColorUI) PrintBlock(block []byte)
- func (ui *ColorUI) PrintErrorBlock(block string)
- func (ui *ColorUI) PrintLinef(pattern string, args ...interface{})
- func (ui *ColorUI) PrintTable(table Table)
- type ComboWriter
- type ConfUI
- func (ui *ConfUI) AskForChoice(opts ChoiceOpts) (int, error)
- func (ui *ConfUI) AskForConfirmation() error
- func (ui *ConfUI) AskForPassword(label string) (string, error)
- func (ui *ConfUI) AskForText(opts TextOpts) (string, error)
- func (ui *ConfUI) BeginLinef(pattern string, args ...interface{})
- func (ui *ConfUI) EnableColor()
- func (ui *ConfUI) EnableJSON()
- func (ui *ConfUI) EnableNonInteractive()
- func (ui *ConfUI) EnableTTY(force bool)
- func (ui *ConfUI) EndLinef(pattern string, args ...interface{})
- func (ui *ConfUI) ErrorLinef(pattern string, args ...interface{})
- func (ui *ConfUI) Flush()
- func (ui *ConfUI) IsInteractive() bool
- func (ui *ConfUI) PrintBlock(block []byte)
- func (ui *ConfUI) PrintErrorBlock(block string)
- func (ui *ConfUI) PrintLinef(pattern string, args ...interface{})
- func (ui *ConfUI) PrintTable(table Table)
- func (ui *ConfUI) ShowColumns(columns []Header)
- type ExternalLogger
- type IndentingUI
- func (ui *IndentingUI) AskForChoice(opts ChoiceOpts) (int, error)
- func (ui *IndentingUI) AskForConfirmation() error
- func (ui *IndentingUI) AskForPassword(label string) (string, error)
- func (ui *IndentingUI) AskForText(opts TextOpts) (string, error)
- func (ui *IndentingUI) BeginLinef(pattern string, args ...interface{})
- func (ui *IndentingUI) EndLinef(pattern string, args ...interface{})
- func (ui *IndentingUI) ErrorLinef(pattern string, args ...interface{})
- func (ui *IndentingUI) Flush()
- func (ui *IndentingUI) IsInteractive() bool
- func (ui *IndentingUI) PrintBlock(block []byte)
- func (ui *IndentingUI) PrintErrorBlock(block string)
- func (ui *IndentingUI) PrintLinef(pattern string, args ...interface{})
- func (ui *IndentingUI) PrintTable(table Table)
- type JSONUI
- func (ui *JSONUI) AskForChoice(_ ChoiceOpts) (int, error)
- func (ui *JSONUI) AskForConfirmation() error
- func (ui *JSONUI) AskForPassword(_ string) (string, error)
- func (ui *JSONUI) AskForText(_ TextOpts) (string, error)
- func (ui *JSONUI) BeginLinef(pattern string, args ...interface{})
- func (ui *JSONUI) EndLinef(pattern string, args ...interface{})
- func (ui *JSONUI) ErrorLinef(pattern string, args ...interface{})
- func (ui *JSONUI) Flush()
- func (ui *JSONUI) IsInteractive() bool
- func (ui *JSONUI) PrintBlock(block []byte)
- func (ui *JSONUI) PrintErrorBlock(block string)
- func (ui *JSONUI) PrintLinef(pattern string, args ...interface{})
- func (ui *JSONUI) PrintTable(table Table)
- type JSONUIResp
- type JSONUITableResp
- type NonInteractiveUI
- func (ui *NonInteractiveUI) AskForChoice(opts ChoiceOpts) (int, error)
- func (ui *NonInteractiveUI) AskForConfirmation() error
- func (ui *NonInteractiveUI) AskForPassword(label string) (string, error)
- func (ui *NonInteractiveUI) AskForText(opts TextOpts) (string, error)
- func (ui *NonInteractiveUI) BeginLinef(pattern string, args ...interface{})
- func (ui *NonInteractiveUI) EndLinef(pattern string, args ...interface{})
- func (ui *NonInteractiveUI) ErrorLinef(pattern string, args ...interface{})
- func (ui *NonInteractiveUI) Flush()
- func (ui *NonInteractiveUI) IsInteractive() bool
- func (ui *NonInteractiveUI) PrintBlock(block []byte)
- func (ui *NonInteractiveUI) PrintErrorBlock(block string)
- func (ui *NonInteractiveUI) PrintLinef(pattern string, args ...interface{})
- func (ui *NonInteractiveUI) PrintTable(table Table)
- type NonTTYUI
- func (ui *NonTTYUI) AskForChoice(opts ChoiceOpts) (int, error)
- func (ui *NonTTYUI) AskForConfirmation() error
- func (ui *NonTTYUI) AskForPassword(label string) (string, error)
- func (ui *NonTTYUI) AskForText(opts TextOpts) (string, error)
- func (ui *NonTTYUI) BeginLinef(pattern string, args ...interface{})
- func (ui *NonTTYUI) EndLinef(pattern string, args ...interface{})
- func (ui *NonTTYUI) ErrorLinef(pattern string, args ...interface{})
- func (ui *NonTTYUI) Flush()
- func (ui *NonTTYUI) IsInteractive() bool
- func (ui *NonTTYUI) PrintBlock(block []byte)
- func (ui *NonTTYUI) PrintErrorBlock(block string)
- func (ui *NonTTYUI) PrintLinef(pattern string, args ...interface{})
- func (ui *NonTTYUI) PrintTable(table Table)
- type NoopLogger
- type PaddingUI
- func (ui *PaddingUI) AskForChoice(opts ChoiceOpts) (int, error)
- func (ui *PaddingUI) AskForConfirmation() error
- func (ui *PaddingUI) AskForPassword(label string) (string, error)
- func (ui *PaddingUI) AskForText(opts TextOpts) (string, error)
- func (ui *PaddingUI) BeginLinef(pattern string, args ...interface{})
- func (ui *PaddingUI) EndLinef(pattern string, args ...interface{})
- func (ui *PaddingUI) ErrorLinef(pattern string, args ...interface{})
- func (ui *PaddingUI) Flush()
- func (ui *PaddingUI) IsInteractive() bool
- func (ui *PaddingUI) PrintBlock(block []byte)
- func (ui *PaddingUI) PrintErrorBlock(block string)
- func (ui *PaddingUI) PrintLinef(pattern string, args ...interface{})
- func (ui *PaddingUI) PrintTable(table Table)
- type TextOpts
- type UI
- type WriterUI
- func (ui *WriterUI) AskForChoice(opts ChoiceOpts) (int, error)
- func (ui *WriterUI) AskForConfirmation() error
- func (ui *WriterUI) AskForPassword(label string) (string, error)
- func (ui *WriterUI) AskForText(opts TextOpts) (string, error)
- func (ui *WriterUI) BeginLinef(pattern string, args ...interface{})
- func (ui *WriterUI) EndLinef(pattern string, args ...interface{})
- func (ui *WriterUI) ErrorLinef(pattern string, args ...interface{})
- func (ui *WriterUI) Flush()
- func (ui *WriterUI) IsInteractive() bool
- func (ui *WriterUI) IsTTY() bool
- func (ui *WriterUI) PrintBlock(block []byte)
- func (ui *WriterUI) PrintErrorBlock(block string)
- func (ui *WriterUI) PrintLinef(pattern string, args ...interface{})
- func (ui *WriterUI) PrintTable(table Table)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChoiceOpts ¶
ChoiceOpts asking for choice options
type ColorUI ¶
type ColorUI struct {
// contains filtered or unexported fields
}
func NewColorUI ¶
func (*ColorUI) AskForChoice ¶
func (ui *ColorUI) AskForChoice(opts ChoiceOpts) (int, error)
func (*ColorUI) AskForConfirmation ¶
func (*ColorUI) BeginLinef ¶
func (*ColorUI) ErrorLinef ¶
func (*ColorUI) IsInteractive ¶
func (*ColorUI) PrintBlock ¶
func (*ColorUI) PrintErrorBlock ¶
func (*ColorUI) PrintLinef ¶
func (*ColorUI) PrintTable ¶
func (ui *ColorUI) PrintTable(table Table)
type ComboWriter ¶
type ComboWriter struct {
// contains filtered or unexported fields
}
func NewComboWriter ¶
func NewComboWriter(ui UI) *ComboWriter
type ConfUI ¶
type ConfUI struct {
// contains filtered or unexported fields
}
func NewConfUI ¶
func NewConfUI(logger ExternalLogger) *ConfUI
func NewWrappingConfUI ¶
func NewWrappingConfUI(parent UI, logger ExternalLogger) *ConfUI
func (*ConfUI) AskForChoice ¶
func (ui *ConfUI) AskForChoice(opts ChoiceOpts) (int, error)
func (*ConfUI) AskForConfirmation ¶
func (*ConfUI) BeginLinef ¶
func (*ConfUI) EnableColor ¶
func (ui *ConfUI) EnableColor()
func (*ConfUI) EnableJSON ¶
func (ui *ConfUI) EnableJSON()
func (*ConfUI) EnableNonInteractive ¶
func (ui *ConfUI) EnableNonInteractive()
func (*ConfUI) ErrorLinef ¶
func (*ConfUI) IsInteractive ¶
func (*ConfUI) PrintBlock ¶
func (*ConfUI) PrintErrorBlock ¶
func (*ConfUI) PrintLinef ¶
func (*ConfUI) PrintTable ¶
func (ui *ConfUI) PrintTable(table Table)
func (*ConfUI) ShowColumns ¶
func (ui *ConfUI) ShowColumns(columns []Header)
type ExternalLogger ¶
type IndentingUI ¶
type IndentingUI struct {
// contains filtered or unexported fields
}
func NewIndentingUI ¶
func NewIndentingUI(parent UI) *IndentingUI
func (*IndentingUI) AskForChoice ¶
func (ui *IndentingUI) AskForChoice(opts ChoiceOpts) (int, error)
func (*IndentingUI) AskForConfirmation ¶
func (ui *IndentingUI) AskForConfirmation() error
func (*IndentingUI) AskForPassword ¶
func (ui *IndentingUI) AskForPassword(label string) (string, error)
func (*IndentingUI) AskForText ¶
func (ui *IndentingUI) AskForText(opts TextOpts) (string, error)
func (*IndentingUI) BeginLinef ¶
func (ui *IndentingUI) BeginLinef(pattern string, args ...interface{})
func (*IndentingUI) EndLinef ¶
func (ui *IndentingUI) EndLinef(pattern string, args ...interface{})
func (*IndentingUI) ErrorLinef ¶
func (ui *IndentingUI) ErrorLinef(pattern string, args ...interface{})
func (*IndentingUI) Flush ¶
func (ui *IndentingUI) Flush()
func (*IndentingUI) IsInteractive ¶
func (ui *IndentingUI) IsInteractive() bool
func (*IndentingUI) PrintBlock ¶
func (ui *IndentingUI) PrintBlock(block []byte)
func (*IndentingUI) PrintErrorBlock ¶
func (ui *IndentingUI) PrintErrorBlock(block string)
func (*IndentingUI) PrintLinef ¶
func (ui *IndentingUI) PrintLinef(pattern string, args ...interface{})
func (*IndentingUI) PrintTable ¶
func (ui *IndentingUI) PrintTable(table Table)
type JSONUI ¶
type JSONUI struct {
// contains filtered or unexported fields
}
func NewJSONUI ¶
func NewJSONUI(parent UI, logger ExternalLogger) *JSONUI
func (*JSONUI) AskForChoice ¶
func (ui *JSONUI) AskForChoice(_ ChoiceOpts) (int, error)
func (*JSONUI) AskForConfirmation ¶
func (*JSONUI) BeginLinef ¶
func (*JSONUI) ErrorLinef ¶
func (*JSONUI) IsInteractive ¶
func (*JSONUI) PrintBlock ¶
func (*JSONUI) PrintErrorBlock ¶
func (*JSONUI) PrintLinef ¶
func (*JSONUI) PrintTable ¶
func (ui *JSONUI) PrintTable(table Table)
type JSONUIResp ¶
type JSONUIResp struct { Tables []JSONUITableResp Blocks []string Lines []string }
type JSONUITableResp ¶
type NonInteractiveUI ¶
type NonInteractiveUI struct {
// contains filtered or unexported fields
}
func NewNonInteractiveUI ¶
func NewNonInteractiveUI(parent UI) *NonInteractiveUI
func (*NonInteractiveUI) AskForChoice ¶
func (ui *NonInteractiveUI) AskForChoice(opts ChoiceOpts) (int, error)
func (*NonInteractiveUI) AskForConfirmation ¶
func (ui *NonInteractiveUI) AskForConfirmation() error
func (*NonInteractiveUI) AskForPassword ¶
func (ui *NonInteractiveUI) AskForPassword(label string) (string, error)
func (*NonInteractiveUI) AskForText ¶
func (ui *NonInteractiveUI) AskForText(opts TextOpts) (string, error)
func (*NonInteractiveUI) BeginLinef ¶
func (ui *NonInteractiveUI) BeginLinef(pattern string, args ...interface{})
func (*NonInteractiveUI) EndLinef ¶
func (ui *NonInteractiveUI) EndLinef(pattern string, args ...interface{})
func (*NonInteractiveUI) ErrorLinef ¶
func (ui *NonInteractiveUI) ErrorLinef(pattern string, args ...interface{})
func (*NonInteractiveUI) Flush ¶
func (ui *NonInteractiveUI) Flush()
func (*NonInteractiveUI) IsInteractive ¶
func (ui *NonInteractiveUI) IsInteractive() bool
func (*NonInteractiveUI) PrintBlock ¶
func (ui *NonInteractiveUI) PrintBlock(block []byte)
func (*NonInteractiveUI) PrintErrorBlock ¶
func (ui *NonInteractiveUI) PrintErrorBlock(block string)
func (*NonInteractiveUI) PrintLinef ¶
func (ui *NonInteractiveUI) PrintLinef(pattern string, args ...interface{})
func (*NonInteractiveUI) PrintTable ¶
func (ui *NonInteractiveUI) PrintTable(table Table)
type NonTTYUI ¶
type NonTTYUI struct {
// contains filtered or unexported fields
}
func NewNonTTYUI ¶
func (*NonTTYUI) AskForChoice ¶
func (ui *NonTTYUI) AskForChoice(opts ChoiceOpts) (int, error)
func (*NonTTYUI) AskForConfirmation ¶
func (*NonTTYUI) BeginLinef ¶
func (*NonTTYUI) ErrorLinef ¶
func (*NonTTYUI) IsInteractive ¶
func (*NonTTYUI) PrintBlock ¶
func (*NonTTYUI) PrintErrorBlock ¶
func (*NonTTYUI) PrintLinef ¶
func (*NonTTYUI) PrintTable ¶
func (ui *NonTTYUI) PrintTable(table Table)
type NoopLogger ¶
type NoopLogger struct{}
func NewNoopLogger ¶
func NewNoopLogger() NoopLogger
func (NoopLogger) Debug ¶
func (l NoopLogger) Debug(tag, msg string, args ...interface{})
func (NoopLogger) Error ¶
func (l NoopLogger) Error(tag, msg string, args ...interface{})
type PaddingUI ¶
type PaddingUI struct {
// contains filtered or unexported fields
}
func NewPaddingUI ¶
func (*PaddingUI) AskForChoice ¶
func (ui *PaddingUI) AskForChoice(opts ChoiceOpts) (int, error)
func (*PaddingUI) AskForConfirmation ¶
func (*PaddingUI) AskForPassword ¶
func (*PaddingUI) BeginLinef ¶
func (*PaddingUI) ErrorLinef ¶
func (*PaddingUI) IsInteractive ¶
func (*PaddingUI) PrintBlock ¶
func (*PaddingUI) PrintErrorBlock ¶
func (*PaddingUI) PrintLinef ¶
func (*PaddingUI) PrintTable ¶
func (ui *PaddingUI) PrintTable(table Table)
type TextOpts ¶
type TextOpts struct { Label string Default string // ValidateFunc: method to validate input/default value ValidateFunc func(string) (bool, string, error) }
TextOpts Asking for text options
type UI ¶
type UI interface { ErrorLinef(pattern string, args ...interface{}) PrintLinef(pattern string, args ...interface{}) BeginLinef(pattern string, args ...interface{}) EndLinef(pattern string, args ...interface{}) PrintBlock([]byte) // takes []byte to avoid string copy PrintErrorBlock(string) PrintTable(Table) AskForText(opts TextOpts) (string, error) AskForChoice(opts ChoiceOpts) (int, error) AskForPassword(label string) (string, error) // AskForConfirmation returns error if user doesnt want to continue AskForConfirmation() error IsInteractive() bool Flush() }
type WriterUI ¶
type WriterUI struct {
// contains filtered or unexported fields
}
func NewConsoleUI ¶
func NewConsoleUI(logger ExternalLogger) *WriterUI
func NewWriterUI ¶
func NewWriterUI(outWriter, errWriter io.Writer, logger ExternalLogger) *WriterUI
func (*WriterUI) AskForChoice ¶
func (ui *WriterUI) AskForChoice(opts ChoiceOpts) (int, error)
func (*WriterUI) AskForConfirmation ¶
func (*WriterUI) BeginLinef ¶
PrintBeginf starts a text line
func (*WriterUI) ErrorLinef ¶
ErrorLinef starts and ends a text error line
func (*WriterUI) IsInteractive ¶
func (*WriterUI) PrintBlock ¶
func (*WriterUI) PrintErrorBlock ¶
func (*WriterUI) PrintLinef ¶
Printlnf starts and ends a text line
func (*WriterUI) PrintTable ¶
func (ui *WriterUI) PrintTable(table Table)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.