Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Encryption ¶
type Encryption struct {
// contains filtered or unexported fields
}
func NewEncryption ¶
func NewEncryption(opts ...OptionsFunc) Encryption
func (Encryption) Decrypt ¶
func (e Encryption) Decrypt(ciphertext string) (string, error)
Decrypt return the input text decrypted
func (Encryption) Encrypt ¶
func (e Encryption) Encrypt(text string) (string, error)
Encrypt return the input text encripted
func (Encryption) GenerateEncryptionKey ¶
func (e Encryption) GenerateEncryptionKey() (string, error)
func (*Encryption) Options ¶
func (e *Encryption) Options(opts ...OptionsFunc)
Options provides the options to encryption
type MockEncription ¶
func NewMockEncryption ¶
func NewMockEncryption() *MockEncription
func (*MockEncription) Decrypt ¶
func (e *MockEncription) Decrypt(ciphertext string) (string, error)
func (*MockEncription) GenerateEncryptionKey ¶
func (e *MockEncription) GenerateEncryptionKey() (string, error)
type OptionsFunc ¶
type OptionsFunc func(opts *Encryption)
OptionsFunc defines the signature for an option function to set encryption
Click to show internal directories.
Click to hide internal directories.