components-contrib/state
Yaron Schneider 75b1fc29b4
Update Readme with Zookeeper (#90)
2019-10-31 21:06:51 -07:00
..
cassandra Add github action for CI (#59) 2019-10-28 15:39:48 -07:00
consul state: initial version for the consul state store implementation (#52) 2019-10-25 21:34:16 -07:00
cosmosdb Add github action for CI (#59) 2019-10-28 15:39:48 -07:00
etcd Add github action for CI (#59) 2019-10-28 15:39:48 -07:00
memcached [WIP] Add memcached state store (#71) 2019-10-31 06:21:04 -07:00
mongodb Adding MongoDB State Store Implementation (#53) 2019-10-31 12:03:04 -07: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 with Zookeeper (#90) 2019-10-31 21:06:51 -07:00
metadata.go Adding license header and updating to MIT license. (#26) 2019-10-09 10:58:08 -07:00
requests.go - adding more corrections 2019-10-10 18:16:08 -07: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
state_store.go Rename the StateStore interface (#70) 2019-10-30 17:44:47 -07:00
transactional_state_store.go Adding and Correcting code comments and types 2019-10-10 18:09:13 -07: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
  • Zookeeper

Implementing a new State Store

A compliant state store needs to implement one or more interfaces: Store and TransactionalStateStore.

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 TransactionalStateStore:

type TransactionalStateStore interface {
	Init(metadata Metadata) error
	Multi(reqs []TransactionalRequest) error
}

See the documentation repo for examples.