Documentation ¶
Index ¶
- Constants
- Variables
- func BufferStdin() *bufio.Reader
- func GetCheckPassword(prompt, prompt2 string, buf *bufio.Reader) (string, error)
- func GetConfirmation(prompt string, buf *bufio.Reader) (bool, error)
- func GetPassword(prompt string, buf *bufio.Reader) (pass string, err error)
- func GetString(prompt string, buf *bufio.Reader) (string, error)
- func OverrideStdin(newStdin *bufio.Reader) (cleanUp func())
- func PrintPrefixed(msg string)
Constants ¶
const MinPassLength = 8
MinPassLength is the minimum acceptable password length
Variables ¶
var ( ErrInvalidGasAdjustment = errors.New("invalid gas adjustment") ErrInvalidSigner = errors.New("tx intended signer does not match the given signer") ErrPassphraseOrPrivKeyRequired = errors.New("passphrase or private key is required") )
common errors for CLI and REST clients
Functions ¶
func BufferStdin ¶
BufferStdin is used to allow reading prompts for stdin multiple times, when we read from non-tty
func GetCheckPassword ¶
GetCheckPassword will prompt for a password twice to verify they match (for creating a new password). It enforces the password length. Only parses password once if input is piped in.
func GetConfirmation ¶
GetConfirmation will request user give the confirmation from stdin. "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again.
func GetPassword ¶
GetPassword will prompt for a password one-time (to sign a tx) It enforces the password length
func OverrideStdin ¶
OverrideStdin allows to temporarily override stdin
func PrintPrefixed ¶
func PrintPrefixed(msg string)
PrintPrefixed prints a string with > prefixed for use in prompts.
Types ¶
This section is empty.