Skip to content
Collection of key-value storages adapters for Golang
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
cmd
config
dedup
docs
graph
indexed
queues
sharded
std
tests
utils
.gitignore
.goreleaser.yml
LICENSE
README.md
base.go
compressed.go
go.mod
go.sum
queues.go
redundancy.go
shard.go

README.md

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/storages-debian {distribution} main" | sudo tee -a /etc/apt/sources.list

Ubuntu 18.04 (bionic)

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

Ubuntu 16.04 (xenial)

echo "deb https://dl.bintray.com/reddec/storages-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.

You can’t perform that action at this time.