Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var New = func(executor func(string), completer func(goprompt.Document) []goprompt.Suggest, opt ...goprompt.Option) Prompt {
return newPrompt(executor, completer, opt...)
}
New instantiates a prompt which satisfied Prompt with c-bata/go-prompt. New will be replace by a mock when e2e testing.
Prompt will panic when called Run if executor is nil.
TODO: Don't declare New as a variable.
Functions ¶
This section is empty.
Types ¶
type Prompt ¶
type Prompt interface { // Run executes Input continually. // It is called from REPL input prompter. // Run will be finished when a user enters CTRL+d. Run() // Input receives user entered input. // Input will be abort when a user enters CTRL+d. Input() (string, error) // Select displays a selection consists of opts. Select(msg string, opts []string) (string, error) // SetPrefix chnages current prompt prefix by passed one. SetPrefix(prefix string) // SetPrefixColor changes current prompt color by passed one. SetPrefixColor(color color.Color) error }
Prompt provides interactive interfaces to receive user input.
Click to show internal directories.
Click to hide internal directories.