Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultPasswordPrompt is used if no prompt is specified on the command // line and one is required any of the options DefaultPasswordPrompt PasswordPrompt = PromptFromTerminal() ErrTwoDifferentPasswords = errors.New("entries do not match") ErrPromptDisabled = errors.New("prompt disabled") // PromptDisabled prevents prompting for a password. May be useful // where there must be no user interaction. PromptDisabled PasswordPrompt = new(noPrompt) )
Functions ¶
This section is empty.
Types ¶
type BufferPrompt ¶
type BufferPrompt []byte
type PasswordPrompt ¶
PasswordPrompt can retrieve a password from somewhere. userPrompt is some text that should be meaningful to the use i.e. a request for a password and path to a file being decrypted. if twice is true then the user will be prompted twice for the input and both values must batch or an error is returned. For prompt methods that do not involve a human the twice argument is ignored.
func PromptFromBuffer ¶
func PromptFromBuffer(b []byte) PasswordPrompt
func PromptFromFile ¶
func PromptFromFile(path string, options ...util.DelayOpenReadOption) PasswordPrompt
func PromptFromStream ¶
func PromptFromStream(r io.Reader) PasswordPrompt
func PromptFromString ¶
func PromptFromString(s string) PasswordPrompt
func PromptFromTerminal ¶
func PromptFromTerminal() PasswordPrompt
Click to show internal directories.
Click to hide internal directories.