components-contrib/state
sayboras 08362d9e6b Added check for go.mod (#141)
* Added check for go.mod

* Rename the make target

* Grrrrr

* Update go.mod and go.sum

* Run gofmt and goimports

* Correct typo
2019-11-25 00:45:51 -08:00
..
azure/cosmosdb Changes to include Package names pubsub/secret stores/state to be consistent with company name (#137) 2019-11-22 12:46:42 -08:00
cassandra Add github action for CI (#59) 2019-10-28 15:39:48 -07:00
couchbase Couchbase state store implementation (#100) 2019-11-18 23:13:41 -08:00
etcd Add github action for CI (#59) 2019-10-28 15:39:48 -07:00
gcp/firestore Changes to include Package names pubsub/secret stores/state to be consistent with company name (#137) 2019-11-22 12:46:42 -08:00
hashicorp/consul Changes to include Package names pubsub/secret stores/state to be consistent with company name (#137) 2019-11-22 12:46:42 -08:00
memcached [WIP] Add memcached state store (#71) 2019-10-31 06:21:04 -07:00
mongodb Adding transactions support to MongoDB (#111) 2019-11-08 11:33:39 -08:00
redis Merge branch 'master' into state-fix 2019-10-29 16:55:12 -07:00
zookeeper [WIP] Add zookeeper state store (#80) 2019-10-31 21:04:34 -07:00
Readme.md Update Readme.md (#129) 2019-11-18 23:53:54 -08:00
metadata.go Adding license header and updating to MIT license. (#26) 2019-10-09 10:58:08 -07:00
requests.go Added check for go.mod (#141) 2019-11-25 00:45:51 -08:00
responses.go - adding more corrections 2019-10-10 18:16:08 -07:00
retry.go Add github action for CI (#59) 2019-10-28 15:39:48 -07:00
retry_test.go Add github action for CI (#59) 2019-10-28 15:39:48 -07:00
store.go Change TransactionalStateStore interface to TransactionalStore (#114) 2019-11-08 12:10:19 -08:00
transactional_store.go Change TransactionalStateStore interface to TransactionalStore (#114) 2019-11-08 12:10:19 -08:00

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.