Documentation
¶
Index ¶
Constants ¶
View Source
const ( Encrypt cryptoOperation = "encrypt" Decrypt cryptoOperation = "decrypt" )
Variables ¶
View Source
var ErrSecretTooShort = encryptor.ErrKeyTooShort
ErrSecretTooShort is returned when the secret key is less than 11 characters long.
Functions ¶
This section is empty.
Types ¶
type InputReader ¶
type InputReader interface {
// ReadString reads a string from the input.
ReadString(sep byte) (string, error)
}
InputReader defines the interface for reading user input.
type InputReaderCaller ¶ added in v1.0.1
type InputReaderCaller func() InputReader
InputReaderCaller is a function that returns an InputReader.
type ReadPSWDFn ¶
ReadPSWDFn defines the function type for reading a password.
var ( // ErrInvalidOperation is returned when the user enters an invalid operation. ErrInvalidOperation = errors.New("invalid operation. Please choose 'encrypt' or 'decrypt'") // ReadPassword is the function for reading a password. ReadPassword ReadPSWDFn = PasswordReader() )
func PasswordReader ¶
func PasswordReader() ReadPSWDFn
type UserInput ¶
type UserInput struct {
Operation cryptoOperation
Path,
OutputPath,
Secret string
}
UserInput defines the structure for user input.
func User ¶
func User(irc InputReaderCaller, readPSWD ReadPSWDFn) (UserInput, error)
User prompts the user to enter the operation, input file path, output file path, and secret key.
Click to show internal directories.
Click to hide internal directories.