Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotImplemented is returned when a required Encryptor function is not set. ErrNotImplemented = errors.New("not implemented") // ErrInvalidXORKey is returned when the key for XOR encryption is not valid. ErrInvalidXORKey = errors.New("invalid xor key") )
Functions ¶
This section is empty.
Types ¶
type Encryptor ¶
type Encryptor struct {
// contains filtered or unexported fields
}
Encryptor implements encryption Interface in order to mock it in tests.
func (*Encryptor) Decrypt ¶
Decrypt calls the configured decrypt function, or returns ErrNotImplemented if it is not set.
type Option ¶
type Option func(*Encryptor)
Option represents configures the Encryptor instance.
func WithDecryptFunc ¶
WithDecryptFunc sets the Encryptor Decrypt function.
func WithEncryptFunc ¶
WithEncryptFunc sets the Encryptor Encrypt function.
func WithResetFunc ¶
func WithResetFunc(f func()) Option
WithResetFunc sets the Encryptor Reset function.
func WithXOREncryption ¶
WithXOREncryption sets Encryptor Encrypt and Decrypt functions with XOR encryption function that uses the provided key for encryption.
Click to show internal directories.
Click to hide internal directories.