components-contrib/state
shalabhs ae8c77f43b Adding and Correcting code comments and types 2019-10-10 18:09:13 -07:00
..
cosmosdb Adding license header and updating to MIT license. (#26) 2019-10-09 10:58:08 -07:00
redis Adding license header and updating to MIT license. (#26) 2019-10-09 10:58:08 -07:00
Readme.md initial commit 2019-09-26 15:47:41 -07:00
metadata.go Adding license header and updating to MIT license. (#26) 2019-10-09 10:58:08 -07:00
requests.go Adding license header and updating to MIT license. (#26) 2019-10-09 10:58:08 -07:00
responses.go Adding license header and updating to MIT license. (#26) 2019-10-09 10:58:08 -07:00
retry.go Adding license header and updating to MIT license. (#26) 2019-10-09 10:58:08 -07:00
retry_test.go Adding and Correcting code comments and types 2019-10-10 18:09:13 -07:00
state_store.go Adding and Correcting code comments and types 2019-10-10 18:09:13 -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:

  • Azure CosmosDB
  • Redis

Implementing a new State Store

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

The interface for StateStore:

type StateStore 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
}