GitPedia
philippgille

philippgille/gokv

Simple key-value store abstraction and implementations for Go (Redis, Consul, etcd, bbolt, BadgerDB, LevelDB, Memcached, DynamoDB, S3, PostgreSQL, MongoDB, CockroachDB and many more)

7 Releases
Latest: 2y ago
v0.7.0 (2024-01-28)release/v0.7.0Latest
philippgillephilippgille·2y ago·January 28, 2024
GitHub

Added

  • New codec: `proto` (for [protocol buffers](https://protobuf.dev/)) (PR [#127](https://github.com/philippgille/gokv/pull/127) by [@glimchb](https://github.com/glimchb))
  • Moved to subdirectory in PR [#138](https://github.com/philippgille/gokv/pull/138)
  • Usage example added in PR [#144](https://github.com/philippgille/gokv/pull/144)
  • Renamed from `proto` to `protobuf` in PR [#171](https://github.com/philippgille/gokv/pull/171)
  • New store implementation: `noop` (PR [#126](https://github.com/philippgille/gokv/pull/126) by [@peczenyj](https://github.com/peczenyj))
  • Optional timeout configuration for `datastore` store implementation (PR [#133](https://github.com/philippgille/gokv/pull/133) by [@glimchb](https://github.com/glimchb))
  • Optional timeout configuration for `redis` store implementation (PR [#130](https://github.com/philippgille/gokv/pull/130) by [@glimchb](https://github.com/glimchb))

📦 Improved

  • Library:
  • Updated dependencies of all modules within the same major version (PR [#108](https://github.com/philippgille/gokv/pull/108) + [#145](https://github.com/philippgille/gokv/pull/145) + [#166](https://github.com/philippgille/gokv/pull/166))
  • So except for a few required major version updates, all dependencies are now up-to-date as of 2024-01-07
  • Major update of `BigCache` dependency
  • First to v2 (PR [#89](https://github.com/philippgille/gokv/pull/89) by [@janisz](https://github.com/janisz))
  • Later to v3 (PR [#158](https://github.com/philippgille/gokv/pull/158))
  • `dyanamodb` tests are now independent of any AWS config/credential file (PR [#108](https://github.com/philippgille/gokv/pull/108))
  • Updated `Hazelcast` dependency to v1.3.0 (PR [#112](https://github.com/philippgille/gokv/pull/112) by [@yuce](https://github.com/yuce))
  • + 25 more

🐛 Fixes

  • Fixed `gomap` data race (PR [#90](https://github.com/philippgille/gokv/pull/90) by [@tdakkota](https://github.com/tdakkota))
  • Includes a regression test covering most (if not all) storage-specific implementations 👍
  • Fixed double CI builds when maintainer pushed a commit to an open PR (PR [#143](https://github.com/philippgille/gokv/pull/143))
  • Fix concurrency tests (PR [#176](https://github.com/philippgille/gokv/pull/176))

💥 Breaking changes

  • `redis` store now has a default timeout of 2 seconds (previously no timeout). You can customize/remove the timeout via the store's config. (PR [#130](https://github.com/philippgille/gokv/pull/130) by [@glimchb](https://github.com/glimchb))
  • `datastore` store: Update of direct dependencies lead to indirect dependency update of `google.golang.org/grpc` from `v1.46.0` to `v1.59.0`, which is incompatible with Go 1.18 due `atomic.Int64` being used, which was introduced in Go 1.19.
  • The `interface{}` to `any` change makes `gokv` incompatible with Go version 1.17 and older. Please open an issue if you're stuck on an old Go version and would like us to revert this change.
  • The switch of the used MongoDB library from an unmaintained 3rd party library to the official one *might* make it incompatible with old MongoDB servers, or with data that was inserted with a previous version of gokv. This is just a warning - it's not confirmed. (PR [#165](https://github.com/philippgille/gokv/pull/165)

New Contributors

  • [@janisz](https://github.com/janisz) made their first contribution in [#89](https://github.com/philippgille/gokv/pull/89)
  • [@yuce](https://github.com/yuce) made their first contribution in [#112](https://github.com/philippgille/gokv/pull/112)
  • [@peczenyj](https://github.com/peczenyj) made their first contribution in [#126](https://github.com/philippgille/gokv/pull/126)
  • [@dependabot](https://github.com/dependabot) made their first contribution in [#122](https://github.com/philippgille/gokv/pull/122)
  • [@glimchb](https://github.com/glimchb) made their first contribution in [#127](https://github.com/philippgille/gokv/pull/127)
v0.6.0 (2019-10-13)v0.6.0
philippgillephilippgille·6y ago·October 13, 2019
GitHub

📋 Changes

  • Added support for [Go modules](https://github.com/golang/go/wiki/Modules) (issue [#81](https://github.com/philippgille/gokv/issues/81))
  • All `gokv.Store` implementations are now separate Go modules
  • Added `gokv.Store` implementations:
  • Package `hazelcast` - A `gokv.Store` implementation for [Hazelcast](https://github.com/hazelcast/hazelcast) (issue [#75](https://github.com/philippgille/gokv/issues/75))
  • Fixed: Compile error in `badgerdb` after a breaking change in BadgerDB 1.6.0
v0.5.0 (2019-01-12)v0.5.0
philippgillephilippgille·7y ago·January 12, 2019
GitHub

📋 Changes

  • Added: Package `encoding` - An abstraction and wrapper for the core functionality of packages like `encoding/json` and `encoding/gob` (issue [#47](https://github.com/philippgille/gokv/issues/47))
  • Added: Package `sql` - It contains shared code for SQL implementations. `mysql` and `postgres` already use it and if you want to create your own SQL implementation you can use it as well. (Useful for issue [#57](https://github.com/philippgille/gokv/issues/57).)
  • Added `gokv.Store` implementations:
  • Package `s3` - A `gokv.Store` implementation for [Amazon S3](https://aws.amazon.com/s3/) (issue [#37](https://github.com/philippgille/gokv/issues/37))
  • Also works for other S3-compatible cloud services like [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces/) and [Scaleway Object Storage](https://www.scaleway.com/object-storage/), as well as for self-hosted solutions like [OpenStack Swift](https://github.com/openstack/swift), [Ceph](https://github.com/ceph/ceph) and [Minio](https://github.com/minio/minio)
  • Package `tablestorage` - A `gokv.Store` implementation for [Azure Table Storage](https://azure.microsoft.com/en-us/services/storage/tables/) (issue [#42](https://github.com/philippgille/gokv/issues/42))
  • Package `datastore` - A `gokv.Store` implementation for [Google Cloud Datastore](https://cloud.google.com/datastore/) (issue [#51](https://github.com/philippgille/gokv/issues/51))
  • Package `tablestore` - A `gokv.Store` implementation for [Alibaba Cloud Table Store](https://www.alibabacloud.com/de/product/table-store) (issue [#70](https://github.com/philippgille/gokv/issues/70))
  • + 9 more
v0.4.0 (2018-12-02)v0.4.0
philippgillephilippgille·7y ago·December 5, 2018
GitHub

📋 Changes

  • Added: Method `Close() error` (issue [#36](https://github.com/philippgille/gokv/issues/36))
  • Added `gokv.Store` implementations:
  • Package `mongodb` - A `gokv.Store` implementation for [MongoDB](https://github.com/mongodb/mongo) (issue [#27](https://github.com/philippgille/gokv/issues/27))
  • Package `dynamodb` - A `gokv.Store` implementation for [Amazon DynamoDB](https://aws.amazon.com/dynamodb/) (issue [#28](https://github.com/philippgille/gokv/issues/28))
  • Package `memcached` - A `gokv.Store` implementation for [Memcached](https://github.com/memcached/memcached) (issue [#31](https://github.com/philippgille/gokv/issues/31))
  • Package `mysql` - A `gokv.Store` implementation for [MySQL](https://github.com/mysql/mysql-server) (issue [#32](https://github.com/philippgille/gokv/issues/32))
  • Added: The factory function `redis.NewClient()` now checks if the connection to the Redis server works and otherwise returns an error.
  • Added: The `test` package now has the function `func TestConcurrentInteractions(t *testing.T, goroutineCount int, store gokv.Store)` that you can use to test your `gokv.Store` implementation with concurrent interactions.
  • + 3 more

💥 Breaking changes

  • The added `Close() error` method (see above) means that previous implementations of `gokv.Store` are not compatible with the interface anymore.
  • Renamed `bolt` package to `bbolt` to reflect the fact that the maintained fork is used. Also changed all other occurrences of "bolt" (e.g. in GoDoc comments etc.).
  • Due to the above mentioned addition to the Redis client factory function, the function signature changed from `func NewClient(options Options) Client` to `func NewClient(options Options) (Client, error)`.
v0.3.0 (2018-11-17)v0.3.0
philippgillephilippgille·7y ago·November 17, 2018
GitHub

📋 Changes

  • Added: Method `Delete(string) error` (issue [#8](https://github.com/philippgille/gokv/issues/8))
  • Added: All `gokv.Store` implementations in this package now also support [gob](https://blog.golang.org/gobs-of-data) as marshal format as alternative to JSON (issue [#22](https://github.com/philippgille/gokv/issues/22))
  • Part of this addition are a new field in the existing `Options` structs, called `MarshalFormat`, as well as the related `MarshalFormat` enum (custom type + related `const` values) in each implementation package
  • Added `gokv.Store` implementations:
  • Package `badgerdb` - A `gokv.Store` implementation for [BadgerDB](https://github.com/dgraph-io/badger) (issue [#16](https://github.com/philippgille/gokv/issues/16))
  • Package `consul` - A `gokv.Store` implementation for [Consul](https://github.com/hashicorp/consul) (issue [#18](https://github.com/philippgille/gokv/issues/18))
  • Package `etcd` - A `gokv.Store` implementation for [etcd](https://github.com/etcd-io/etcd) (issue [#24](https://github.com/philippgille/gokv/issues/24))

💥 Breaking changes

  • The added `Delete(string) error` method (see above) means that previous implementations of `gokv.Store` are not compatible with the interface anymore.
  • Changed: The `NewStore()` function in `gomap` and `syncmap` now has an `Option` parameter. Required for issue [#22](https://github.com/philippgille/gokv/issues/22).
  • Changed: Passing an empty string as key to `Set()`, `Get()` or `Delete()` now results in an error
  • Changed: Passing `nil` as value parameter to `Set()` or as pointer to `Get()` now results in an error. This change leads to a consistent behaviour across the different marshal formats (otherwise for example `encoding/json` marshals `nil` to `null` while `encoding/gob` returns an error).
v0.2.0 (2018-11-05)v0.2.0
philippgillephilippgille·7y ago·November 6, 2018
GitHub

📋 Changes

  • Added `gokv.Store` implementation:
  • Package `gomap` - A `gokv.Store` implementation for a plain Go map with a `sync.RWMutex` for concurrent access (issue [#11](https://github.com/philippgille/gokv/issues/11))
  • Improved: Every `gokv.Store` implementation resides in its own package now, so when downloading the package of an implementation, for example with `go get github.com/philippgille/gokv/redis`, only the actually required dependencies are downloaded and compiled, making the process much faster. This is especially useful for example when creating Docker images, where in many cases (depending on the `Dockerfile`) the download and compilation are repeated for *each build*. (Issue [#2](https://github.com/philippgille/gokv/issues/2))
  • Improved: The performance of `bolt.Store` should be higher, because unnecessary manual locking was removed. (Issue [#1](https://github.com/philippgille/gokv/issues/1))
  • Fixed: The `gokv.Store` implementation for bbolt / Bolt DB used data from within a Bolt transaction outside of it, without copying the value, which can lead to errors (see [here](https://github.com/etcd-io/bbolt/blob/76a4670663d125b6b89d47ea3cc659a282d87c28/doc.go#L38)) (issue [#13](https://github.com/philippgille/gokv/issues/13))

💥 Breaking changes

  • All `gokv.Store` implementations were moved into their own packages and the structs that implement the interface were renamed to avoid unidiomatic "stuttering".
v0.1.0 (2018-10-14)v0.1.0
philippgillephilippgille·7y ago·October 13, 2018
GitHub

📋 Changes

  • Interface with `Set(string, interface{}) error` and `Get(string, interface{}) (bool, error)`
  • Implementations for:
  • [bbolt](https://github.com/etcd-io/bbolt) (formerly known as Bolt / Bolt DB)
  • Go map (`sync.Map`)
  • [Redis](https://github.com/antirez/redis)