Documentation ¶
Index ¶
- Variables
- type Avocado
- func (a *Avocado) Delete(key []byte) error
- func (a *Avocado) EecryptAndStoreValue(key, value []byte, publicKeyPath string) ([]byte, error)
- func (a *Avocado) FindAndDecryptValueBy(key []byte, privateKeyPath string) ([]byte, error)
- func (a *Avocado) GetAllKeys() ([][]byte, error)
- func (a *Avocado) New(config *StorageClient) error
- type BboltStorage
- type RedisStorage
- type StorageClient
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorFilePathNotProvided = errors.New("file path not provided") ErrorValueNotProvided = errors.New("value not provided") ErrorKeyNotProvided = errors.New("value label not provided") ErrorEncryptedValueNotFound = errors.New("encrypted value not found") )
Error messages
Functions ¶
This section is empty.
Types ¶
type Avocado ¶
type Avocado struct {
// contains filtered or unexported fields
}
Avocado defines RSA keys and storage configurations
func (*Avocado) EecryptAndStoreValue ¶
EecryptAndStoreValue encrypt and store value using RSA public key @param key and value in byte format @return encrypted value bytes
func (*Avocado) FindAndDecryptValueBy ¶
FindAndDecryptValueBy find and decrypt value method read private key from file @param key in byte format @return decrypted value bytes
func (*Avocado) GetAllKeys ¶
GetAllKeys return all keys @return all keys
func (*Avocado) New ¶
func (a *Avocado) New(config *StorageClient) error
New constructs a key value to store
type BboltStorage ¶
type BboltStorage struct { SotoragePath string BucketName string // contains filtered or unexported fields }
BboltStorage defines bbolt client settings
type RedisStorage ¶
type RedisStorage struct { Address string Password string DB int // contains filtered or unexported fields }
RedisStorage defines redis client settings
type StorageClient ¶
type StorageClient struct { Bbolt *BboltStorage Redis *RedisStorage }
StorageClient defines key value storage client type
func (*StorageClient) New ¶
func (sc *StorageClient) New() error
New create a new instance of storage client
Click to show internal directories.
Click to hide internal directories.