terminal

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: Unlicense Imports: 11 Imported by: 2

Documentation

Overview

Package terminal provides utility function to read from terminals.

Index

Constants

This section is empty.

Variables

View Source
var ErrAbort = errors.New("aborted")

ErrAbort is returned if a user answers 'n' to Confirm.

Functions

func Confirm

func Confirm(question string) error

Confirm asks the user to confirm the question with yes or no.

func ReadLine

func ReadLine(r io.Reader) ([]byte, error)

ReadLine reads a single line from r it and returns it (without trailing newline).

func ReadPassphrase

func ReadPassphrase(fd int, confirm bool) ([]byte, error)

ReadPassphrase reads a single line from fd without local echo and returns it (without trailing newline). When confirm is true it reads a second line and makes sure both passphrases match.

Types

This section is empty.

Jump to

Keyboard shortcuts

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