SaintWish / kv

A few Go key value map packages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kv

GoDoc

A collection of a few Go packages for Key Value storage like caches.

go get github.com/saintwish/kv

Packages

All of the packages of generic support for safety. Some of the packages use the swiss map instead of the default Go map.

  • kv1 - A Key Value sharded cache with time expiration. Uses swiss map.

  • kv1s - A Key Value sharded cache without any auto eviction. Uses swiss map.

  • kv2 - A Key Value sharded cache with a max size and automated eviction when the map gets full. I wouldn't use it because that eviction method is flawed. Uses swiss map.

  • kvswiss - A Key Value cache that is non-sharded using the swiss map as it's backend.

  • kvmap - A Key Value sharded cache using vanilla Go map with no auto eviction.

  • ccmap - A concurrent safe default Go map without sharding.

  • stack - A last in, first out stack implementation without concurrency support. Used in the kv2 package.

Benchmarks

You can run benchmarks in the "main" using go test -bench . -benchmem. There's some packages missing from the benchmarks however because they should be the same as kv1 one basically except for different eviction methods.

Licensing

The swiss map and this package are licensed with Apache-2.0

About

A few Go key value map packages.

License:Apache License 2.0


Languages

Language:Go 99.1%Language:Assembly 0.9%