input

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSecureString

func GetSecureString(prompt string, w io.Writer, terminal TerminalReader) (string, error)

GetSecureString reads a password from the terminal

Types

type DefaultTerminal

type DefaultTerminal struct{}

DefaultTerminal implements real terminal operations

func (*DefaultTerminal) IsTerminal

func (t *DefaultTerminal) IsTerminal(fd int) bool

IsTerminal checks if we are attached to a real terminal

func (*DefaultTerminal) ReadPassword

func (t *DefaultTerminal) ReadPassword(fd int) ([]byte, error)

ReadPassword reads a password from the terminal

type TerminalReader

type TerminalReader interface {
	ReadPassword(fd int) ([]byte, error)
	IsTerminal(fd int) bool
}

TerminalReader interface for reading secure input

Jump to

Keyboard shortcuts

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