getpass

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: BSD-3-Clause Imports: 3 Imported by: 4

README

getpass

GoDoc CI

This repository provides a Go package to read passwords from the terminal with echo disabled. This implementation relies on the x/sys/unix package to read and write terminal settings.

Documentation

Overview

Package getpass supports reading text from a terminal with echo disabled, suitable for prompting a user for a passphrase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Prompt

func Prompt(prompt string) (string, error)

Prompt prints the prompt string to the TTY of the current process and then calls Readline to read a line of text with echo disabled.

func Readline

func Readline() (string, error)

Readline reads a single line of text from the TTY of the current process, with echo disabled. The line is returned without its trailling newline and echo is re-enabled before returning.

func TTY

func TTY() (*os.File, error)

TTY opens the controlling terminal of the current process if possible.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳