pwinput

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: LGPL-3.0 Imports: 5 Imported by: 1

README

Package

github.com/tappoy/pwinput

See Document.txt

License

LGPL-3.0

Author

tappoy

Documentation

Overview

This package provides a robust way to read password from the terminal.

  • Read password from the stdin.
  • Mute the terminal while inputting the password.
  • If interrupted while inputting the password, the terminal will be turned back to normal.

Index

Constants

This section is empty.

Variables

View Source
var (
	// The input process is interrupted.
	ErrInterrupted = errors.New("ErrInterrupted")
)

Functions

This section is empty.

Types

type PasswordInput added in v1.1.0

type PasswordInput interface {
	// InputPassword reads a password from the terminal.
	// If DummyPasswordInput is used, it will return the dummy password.
	//   Errors:
	//   - ErrInterrupted
	InputPassword() (string, error)
}

func NewDummyPasswordInput added in v1.1.0

func NewDummyPasswordInput(dummyPassword string) PasswordInput

Create a dummy password reader for testing or some other purposes. It will return the dummy password when calling `Inputssword()`.

func NewPasswordInput added in v1.1.0

func NewPasswordInput() PasswordInput

Create a new password reader.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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