Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPrompts ¶
type IPrompts interface { UsernamePassword() (string, string, error) KeyPassphrase(string) string Password(msg string) string PHI() error YesNo(msg string) error OTP(string) string }
IPrompts is the interface in which to interact with the user and accept input.
type SPrompts ¶
type SPrompts struct{}
SPrompts is a concrete implementation of IPrompts
func (*SPrompts) KeyPassphrase ¶
KeyPassphrase prompts a user to enter a passphrase for a named key.
func (*SPrompts) PHI ¶
PHI prompts a user to accept liability for downloading PHI to their local machine.
func (*SPrompts) Password ¶
Password prompts the user for a password displaying the given message. The password will be hidden while typed. A newline is not added to the given message. If a newline is required, it should be part of the passed in string.
func (*SPrompts) UsernamePassword ¶
UsernamePassword prompts a user to enter their username and password.
func (*SPrompts) YesNo ¶
YesNo outputs a given message and waits for a user to answer `y/n`. If yes, flow continues as normal. If no, an error is returned. The given message SHOULD contain the string "(y/n)" or some other form of y/n indicating that the user needs to type in y or n. This method does not do that for you. The message will not have a new line appended to it. If you require a newline, add this to the given message.