Documentation
¶
Index ¶
- Variables
- func IsInteractive() bool
- func ReadKey(prompt ...string) (rune, error)
- func ReadKeyOf(prompt string, keys ...rune) (rune, error)
- func ReadKeyOfSilent(prompt string, keys ...rune) (rune, error)
- func ReadKeyOrDefaultOf(prompt string, def rune, others ...rune) (rune, error)
- func ReadKeyOrDefaultOfSilent(prompt string, def rune, others ...rune) (rune, error)
- func ReadKeySilent(prompt ...string) (rune, error)
- func ReadLine(prompt string) (string, error)
- func ReadSecret(prompt string) (string, error)
- func SpinnerStart()
- func SpinnerStop()
Constants ¶
This section is empty.
Variables ¶
var Error = color.New()
var Muted = color.New(color.FgHiBlack)
Functions ¶
func IsInteractive ¶
func IsInteractive() bool
func ReadKey ¶
ReadKey writes the prompt to the terminal and waits for a single key press. It returns the key pressed as a rune, handling multi-byte characters, and echoes it.
func ReadKeyOf ¶
ReadKeyOf writes the prompt and waits for a key press that matches one of the provided runes. It keeps prompting until a valid key is pressed, echoes it, and returns that rune.
func ReadKeyOfSilent ¶
ReadKeyOfSilent writes the prompt and waits for a key press that matches one of the provided runes silently. It keeps prompting until a valid key is pressed and returns that rune.
func ReadKeyOrDefaultOf ¶
ReadKeyOrDefaultOf writes the prompt and waits for a key press that matches one of the provided runes. If the Enter key (rune '\r') is pressed, it echoes and returns the default rune.
func ReadKeyOrDefaultOfSilent ¶
ReadKeyOrDefaultOfSilent writes the prompt and waits for a key press that matches one of the provided runes silently. If the Enter key (rune '\r') is pressed, it returns the default rune.
func ReadKeySilent ¶
ReadKeySilent writes the prompt to the terminal and waits for a single key press silently. It returns the key pressed as a rune, handling multi-byte characters.
func ReadSecret ¶
ReadSecret reads a secret from the terminal without echoing it.
func SpinnerStart ¶
func SpinnerStart()
func SpinnerStop ¶
func SpinnerStop()
Types ¶
This section is empty.