prompt

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2018 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FirstTty = -1

Functions

func AskForPassword

func AskForPassword(tty *os.File, ttyNum int, settings DialogSettings) (*memguard.LockedBuffer, int, error)

AskForPassword does everything needed to get a password from user through specified TTY.

Returned values are: Pointer to password buffer, length of password, error if any.

func AskToConfirm

func AskToConfirm(tty *os.File, ttyNum int, settings DialogSettings) (bool, error)

func LockTTY

func LockTTY(tty *os.File)

func ReadPassword

func ReadPassword(tty *os.File, output []byte, echoChar string) ([]byte, error)

ReadPassword configures TTY to non-canonical mode and reads password byte-by-byte showing '*' for each character.

func ShowMessage

func ShowMessage(tty *os.File, ttyNum int, settings DialogSettings) error

func UnlockTTY

func UnlockTTY(tty *os.File)

func WritePrompt

func WritePrompt(tty *os.File, settings DialogSettings) error

Types

type DialogSettings

type DialogSettings struct {
	Title       string
	Description string
	Prompt      string
	PassChar    string
}

type ExeContext

type ExeContext struct {
	User        string
	Group       string
	ParentPID   string
	ParentPath  string
	StartupTime time.Time
}

func CaptureExeCtx

func CaptureExeCtx() (*ExeContext, error)

func (ExeContext) String

func (ctx ExeContext) String() string

Jump to

Keyboard shortcuts

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