Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInput ¶
func GetInput(prompt, def, after string, limitMax, limitMin int) (b *memguard.LockedBuffer, err error)
GetInput prompts the user for input and then reads a single newline-terminated line from stdin and returns it as a memguard.LockedBuffer with the terminating newline removed.
It also enforces the user to provide a limited number of characters bound by limitMax and limitMin. If an empty input is allowed (indicated by lmitMin = 0) GetInput can optionally return a default value.
func GetMaskedInput ¶
func GetMaskedInput(prompt, def, after string, limitMax, limitMin int) (b *memguard.LockedBuffer, err error)
GetMaskedInput prompts the user for input and then reads a single newline-terminated line from stdin and returns it as a memguard.LockedBuffer with the terminating newline removed. User input is not displayed in the console.
It also enforces the user to provide a limited number of characters bound by limitMax and limitMin. If an empty input is allowed (indicated by lmitMin = 0) GetInput can optionally return a default value.
If standard input is not interactive (ex. redirected from another process) all prompts, limit checks and fallbacks are disabled and raw input is returned.
Types ¶
This section is empty.