Documentation ¶
Index ¶
- type Messenger
- func (m *Messenger) Failure(line string, args ...any)
- func (m *Messenger) FailureErr(line string, args ...any)
- func (m *Messenger) FailureTag(tag string, line string, args ...any)
- func (m *Messenger) FailureTagErr(tag string, line string, args ...any)
- func (m *Messenger) Info(line string, args ...any)
- func (m *Messenger) InfoErr(line string, args ...any)
- func (m *Messenger) InfoTag(tag string, line string, args ...any)
- func (m *Messenger) InfoTagErr(tag string, line string, args ...any)
- func (m *Messenger) Success(line string, args ...any)
- func (m *Messenger) SuccessErr(line string, args ...any)
- func (m *Messenger) SuccessTag(tag string, line string, args ...any)
- func (m *Messenger) SuccessTagErr(tag string, line string, args ...any)
- func (m *Messenger) Warning(line string, args ...any)
- func (m *Messenger) WarningErr(line string, args ...any)
- func (m *Messenger) WarningTag(tag string, line string, args ...any)
- func (m *Messenger) WarningTagErr(tag string, line string, args ...any)
- type Prompter
- type SurveyPrompter
- func (p *SurveyPrompter) Confirm(prompt string, defaultValue bool, help string) (bool, error)
- func (p *SurveyPrompter) Input(prompt string, defaultValue string, help string) (string, error)
- func (p *SurveyPrompter) MultiSelect(prompt string, options []string, defaultValues []string, help string) ([]string, error)
- func (p *SurveyPrompter) Select(prompt string, options []string, defaultValue string, help string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Messenger ¶
type Messenger struct {
// contains filtered or unexported fields
}
Messenger is a generic logger that prefixes lines with status icons.
func NewMessenger ¶
NewMessenger returns a new IconLogger.
func (*Messenger) FailureErr ¶
FailureErr prints line to StdErr prefixed with "✖".
func (*Messenger) FailureTag ¶
FailureTag prints line to StdOut prefixed with "✖ [tag] ".
func (*Messenger) FailureTagErr ¶
FailureTagErr prints line to StdErr prefixed with "✖ [tag] ".
func (*Messenger) InfoTagErr ¶
InfoTagErr prints line to StdErr prefixed with "• [tag] ".
func (*Messenger) SuccessErr ¶
SuccessErr prints line to StdErr prefixed with "✓".
func (*Messenger) SuccessTag ¶
SuccessTag prints line to StdOut prefixed with "✓ [tag] ".
func (*Messenger) SuccessTagErr ¶
SuccessTagErr prints line to StdErr prefixed with "✓ [tag] ".
func (*Messenger) WarningErr ¶
WarningErr prints line to StdErr prefixed with "!".
func (*Messenger) WarningTag ¶
WarningTag prints line to StdOut prefixed with "! [tag] ".
type Prompter ¶
type Prompter interface { // Confirm prompts for a boolean yes/no value. Confirm(msg string, value bool, help string) (bool, error) // Input prompts for single string value. Input(msg string, value string, help string) (string, error) // MultiSelect prompts for a slice of string values w/ a fixed set of options. MultiSelect(msg string, options []string, values []string, help string) ([]string, error) // Select prompts for single string value w/ a fixed set of options. Select(msg string, options []string, value string, help string) (string, error) }
Prompter is an interface for types that prompt for user input.
type SurveyPrompter ¶
type SurveyPrompter struct {
// contains filtered or unexported fields
}
SurveyPrompter is a light wrapper around the survey(https://github.com/go-survey/survey) library.
func NewSurveyPrompter ¶
func NewSurveyPrompter(in fileReader, out fileWriter, err fileWriter, s session) *SurveyPrompter
func (*SurveyPrompter) MultiSelect ¶
func (p *SurveyPrompter) MultiSelect( prompt string, options []string, defaultValues []string, help string, ) ([]string, error)
MultiSelect prompts for a slice of string values w/ a fixed set of options.