Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultPrompt = "Please Input: " DefaultValidateOkPrefix = "✔" DefaultValidateErrPrefix = "✘" ColorPrompt = "2" )
Variables ¶
This section is empty.
Functions ¶
func VFDoNothing ¶
VFDoNothing is a verification function that does nothing
func VFNotBlank ¶
VFNotBlank is a verification function that checks whether the input is empty
Types ¶
type EchoMode ¶
type EchoMode int
EchoMode sets the input behavior of the text input field.
const ( // EchoNormal displays text as is. This is the default behavior. EchoNormal EchoMode = iota // EchoPassword displays the EchoCharacter mask instead of actual // characters. This is commonly used for password fields. EchoPassword // EchoNone displays nothing as characters are entered. This is commonly // seen for password fields on the command line. EchoNone )
copy from textinput.Model
type Model ¶
type Model struct { // CharLimit is the maximum amount of characters this input element will // accept. If 0 or less, there's no limit. CharLimit int // Width is the maximum number of characters that can be displayed at once. // It essentially treats the text field like a horizontally scrolling // viewport. If 0 or less this setting is ignored. Width int // Prompt is the prefix of the prompt library, the user needs to define // the format(including spaces) Prompt string // ValidateFunc is a "real-time verification" function, which verifies // whether the terminal input data is legal in real time ValidateFunc func(string) error // ValidateOkPrefix is the prompt prefix when the validation fails ValidateOkPrefix string // ValidateErrPrefix is the prompt prefix when the verification is successful ValidateErrPrefix string // EchoMode sets the input behavior of the text input field. EchoMode EchoMode // contains filtered or unexported fields }
Model is a data container used to store TUI status information, the ui rendering success style is as follows:
✔ Please Input: aaaa
Click to show internal directories.
Click to hide internal directories.