* Added check for go.mod * Rename the make target * Grrrrr * Update go.mod and go.sum * Run gofmt and goimports * Correct typo |
||
|---|---|---|
| .. | ||
| azure/cosmosdb | ||
| cassandra | ||
| couchbase | ||
| etcd | ||
| gcp/firestore | ||
| hashicorp/consul | ||
| memcached | ||
| mongodb | ||
| redis | ||
| zookeeper | ||
| Readme.md | ||
| metadata.go | ||
| requests.go | ||
| responses.go | ||
| retry.go | ||
| retry_test.go | ||
| store.go | ||
| transactional_store.go | ||
Readme.md
State Stores
State Stores provide a common way to interact with different data store implementations, and allow users to opt-in to advanced capabilities using defined metadata.
Currently supported state stores are:
- Redis
- HashiCorp Consul
- Etcd
- Cassandra
- Azure CosmosDB
- Memcached
- MongoDB
- Zookeeper
- Cloud Firestore (Datastore mode)
- Couchbase
Implementing a new State Store
A compliant state store needs to implement one or more interfaces: Store and TransactionalStore.
The interface for Store:
type Store interface {
Init(metadata Metadata) error
Delete(req *DeleteRequest) error
BulkDelete(req []DeleteRequest) error
Get(req *GetRequest) (*GetResponse, error)
Set(req *SetRequest) error
BulkSet(req []SetRequest) error
}
The interface for TransactionalStore:
type TransactionalStore interface {
Init(metadata Metadata) error
Multi(reqs []TransactionalRequest) error
}
See the documentation repo for examples.