All Projects → reddec → storages

reddec / storages

Licence: MIT license
Collection of key-value storages adapters for Golang

Programming Languages

go
31211 projects - #10 most used programming language

Collection of storages (and wrappers)

Documentation license donate

Different implementations of storages with same abstract interface:

// Thread-safe storage for key-value
type Storage interface {
	// Put single item to storage. If already exists - override
	Put(key []byte, data []byte) error
	// Get item from storage. If not exists - os.ErrNotExist (implementation independent)
	Get(key []byte) ([]byte, error)
	// Delete key and value
	Del(key []byte) error
	// Iterate over all keys. Modification during iteration may cause undefined behaviour (mostly - dead-lock)
	Keys(handler func(key []byte) error) error
    // Close storage if needs
    io.Closer
}

See documentation for details

one more example...

You can create different storage types just by URL (if you imported required package):

For example, use Redis db as a backend

storage, err := std.Create("redis://localhost")
if err != nil {
    panic(err)
}
defer storage.Close()

CLI tools

Binary

Look to releases section

Debian/Ubuntu

Debian version

Add public Bintray key

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61

Add repository

  • supported distribution: trusty, xenial, bionic, buster, wheezy
echo "deb https://dl.bintray.com/reddec/debian {distribution} main" | sudo tee -a /etc/apt/sources.list

Ubuntu 18.04 (bionic)

echo "deb https://dl.bintray.com/reddec/debian bionic main" | sudo tee -a /etc/apt/sources.list

Ubuntu 16.04 (xenial)

echo "deb https://dl.bintray.com/reddec/debian xenial main" | sudo tee -a /etc/apt/sources.list

Update cache

sudo apt-get update

Install

sudo apt-get install storages

Build from source

  • requires Go 1.13+

go get github.com/reddec/storages/cmd/...

License

The wrappers itself licensed under MIT but used libraries may have different license politics.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].