Documentation ¶
Index ¶
Constants ¶
View Source
const MinPasswordLen = 8
Variables ¶
TerminalStdio interacts with users over stdin/stdout/stderr.
Functions ¶
This section is empty.
Types ¶
type StdIO ¶
type StdIO interface { // Write prints some bytes to stdout. Write(p []byte) (n int, err error) // WriteErr prints some bytes to stderr. WriteErr(p []byte) (n int, err error) // Banner displays informational text to the user. Banner(message string) error // Error displays an error message to the user. Error(message string) error // IsInteractive signals whether interactive I/O is supported. IsInteractive() bool // GetStringInput prompts the user for arbitrary input. GetStringInput(prompt, defaultValue string) (string, error) // GetSecret prompts the user for a secret. GetSecret(prompt string, minLen int) (string, error) // GetPassword prompts the user for a secret twice, and inputs must match. // Uses stdio.MinPasswordLen as the minimum input length GetPassword(prompt string) (string, error) // GetConfirm asks the user for a y/n answer to a prompt. GetConfirm(prompt string) bool }
Click to show internal directories.
Click to hide internal directories.