input

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func IsAborted(err error) bool

IsAborted reports whether an operation was aborted by the user (typically via Ctrl+C), by checking for ErrInputAborted and context cancellation.

func MapInputError

func MapInputError(err error) error

MapInputError normalizes common stdin errors (EOF/closed fd) into ErrInputAborted.

func ReadLineWithContext

func ReadLineWithContext(ctx context.Context, reader *bufio.Reader) (string, error)

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.

Jump to

Keyboard shortcuts

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