Skip to content

lorenzodisidoro/avocado-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card Build Status

Avocado SDK

Avocado SDK encrypt with RSA keys a values ​​to be store in the key-value store.

Supported

How to

Install

To start using Avocado SDK, install Go and run go get command as a follow

go get github.com/lorenzodisidoro/avocado-sdk

Use

To use SDK methods import in your GO file

import sdk "github.com/lorenzodisidoro/avocado-sdk"

Storage configuration

Create the storage configuration

BBolt

storage := &sdk.StorageClient{
    Bbolt: &sdk.BboltStorage{
        SotoragePath: "./mybolt.db",
        BucketName:   "test",
    },
}

Redis

storage := &StorageClient{
	Redis: &RedisStorage{
		Address:  "localhost:6379",
		Password: "", // no password set
		DB:       0,  // use default DB
	},
}

Create a new instance

Create a new SDK instance

avocado := sdk.Avocado{}
err := avocado.New(storage)
if err != nil {
    return err
}

Methods

Encrypt and save value

Value can be encrypted and stored using the following methods

encryptedValue, err := avocado.EecryptAndStoreValue([]byte("key1"), []byte("my value"), "/path/to/my_public_key.pem")

Find and decrypt value

decryptedValue, err := avocado.FindAndDecryptValueBy([]byte("key1"), "/path/to/my_private_key.pem")

Get all keys

keys, err := avocado.GetAllKeys()

Remove a key

err := avocado.Delete([]byte("key1"))

About

Avocado SDK encrypt with RSA keys a values ​​to be store in the key-value store.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages