input

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2025 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPipedOrRedirected

func IsPipedOrRedirected(fi os.FileInfo) bool

func PromptNewPassword

func PromptNewPassword(w io.Writer, fd int, length int) ([]byte, error)

PromptNewPassword prompts the user to enter a new password of the specified length. The prompt is displayed via the writer w, and input is read from the given file descriptor fd.

func PromptPassword

func PromptPassword(w io.Writer, fd int) ([]byte, error)

PromptPassword prompts the user to enter the current password securely. The prompt is displayed via the writer w, and input is read from the given file descriptor fd.

func PromptRead

func PromptRead(w io.Writer, r io.Reader, prompt string, a ...any) (string, error)

PromptRead prompts via w for input and reads it from r until a newline is entered.

func PromptReadSecure

func PromptReadSecure(w io.Writer, fd int, prompt string, a ...any) ([]byte, error)

PromptReadSecure prompts the user via w for input and securely reads it from the given file descriptor.

func SetDefaultReadPassword

func SetDefaultReadPassword(f func(fd int) ([]byte, error))

SetDefaultReadPassword overrides readPasswordFunc for testing.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL