Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInputAborted = errors.New("input aborted")
ErrInputAborted signals that interactive input was interrupted (typically via Ctrl+C causing context cancellation and/or stdin closure).
Callers should translate this into the appropriate workflow-level abort error.
Functions ¶
func IsAborted ¶ added in v0.12.8
IsAborted reports whether an operation was aborted by the user (typically via Ctrl+C), by checking for ErrInputAborted and context cancellation.
func MapInputError ¶
MapInputError normalizes common stdin errors (EOF/closed fd) into ErrInputAborted.
func ReadLineWithContext ¶
ReadLineWithContext reads a single line and supports cancellation. On ctx cancellation or stdin closure it returns ErrInputAborted. On ctx deadline it returns context.DeadlineExceeded.
func ReadPasswordWithContext ¶
func ReadPasswordWithContext(ctx context.Context, readPassword func(int) ([]byte, error), fd int) ([]byte, error)
ReadPasswordWithContext reads a password (no echo) and supports cancellation. On ctx cancellation or stdin closure it returns ErrInputAborted. On ctx deadline it returns context.DeadlineExceeded.
Types ¶
This section is empty.