karantin2020 / svalkey

Secure multi backend key/value storage abstraction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

svalkey

GoDoc Coverage Status Go Report Card

Overview

svalkey provides a Go native library to securely store metadata using Distributed Key/Value stores (or common databases).

What it does

  1. Auto marshal/unmarshal data. You can choose XMLCodec (with NewJSONStore), JSONCodec (with NewXMLStore), GobCodec (with NewStore). Default is GobCodec (just call NewStore func).
    Store implements func Put(key string, value interface{}, options *store.WriteOptions) error which converts value into []byte.
    Store implements func Get(key string, value interface{}, options *store.ReadOptions) error which pulls value in []byte from db and converts into needed type.
  2. Auto en/decrypt data with github.com/minio/sio. You can choose AES-256-GCM and chacha20-poly1305. Just pass your secret key. To store data svalkey derives key for every key/value pair write with golang.org/x/crypto/hkdf.
  3. Puts/pulls data into/from db. You can choose local or distributed db that is supported by github.com/abronan/valkeyrie.

Install

go get -u -v github.com/karantin2020/svalkey

The goal of svalkey is to abstract common store operations (Get/Put/List/etc.) for multiple distributed and/or local Key/Value store backends thus using the same self-contained codebase to manage them all.

This lib is based on:

As of now, svalkey offers support for Consul, Etcd, Zookeeper, Redis (Distributed store) and BoltDB (Local store) with AES-256-GCM and chacha20-poly1305 en/decryption implementations.

Usage

svalkey is meant to be used as an abstraction layer over existing distributed Key/Value stores. It is especially useful if you plan to support consul, etcd and zookeeper using the same codebase.

It is ideal if you plan for something written in Go that should support:

  • A simple secure metadata storage, distributed or local

You can also easily implement a Crypter interface to use your own crypt algorithm.

You can find examples of usage for svalkey in tests.

About

Secure multi backend key/value storage abstraction


Languages

Language:Go 99.7%Language:Makefile 0.3%