components-contrib/state
Phil Kedy a28587ed98
Resolving gofumpt issues (#932)
2021-06-09 15:18:50 -07:00
..
aerospike add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
aws/dynamodb add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
azure add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
cassandra add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
cloudstate fix a typo (#910) 2021-06-04 12:08:40 -07:00
couchbase add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
gcp/firestore add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
hashicorp/consul add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
hazelcast add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
memcached add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
mongodb add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
mysql add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
postgresql add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
redis Move the common Redis code to internal (#859) 2021-06-06 23:24:36 -07:00
rethinkdb add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
sqlserver Resolving gofumpt issues (#932) 2021-06-09 15:18:50 -07:00
utils change headers (#679) 2021-02-09 18:57:55 -08:00
zookeeper Resolving gofumpt issues (#932) 2021-06-09 15:18:50 -07:00
Readme.md Update docs with new docs links (#513) 2020-10-26 11:52:20 -07:00
errors.go change headers (#679) 2021-02-09 18:57:55 -08:00
errors_test.go change headers (#679) 2021-02-09 18:57:55 -08:00
feature.go Add Feature list for state store. (#744) 2021-03-05 14:55:23 -08:00
metadata.go change headers (#679) 2021-02-09 18:57:55 -08:00
request_options.go change headers (#679) 2021-02-09 18:57:55 -08:00
request_options_test.go change headers (#679) 2021-02-09 18:57:55 -08:00
requests.go change headers (#679) 2021-02-09 18:57:55 -08:00
responses.go add BulkGetResponse comments (#845) 2021-05-13 23:10:09 -07:00
store.go add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
store_test.go add Ping operation to`store` interface. (#757) 2021-05-25 23:48:46 -07:00
transactional_store.go change headers (#679) 2021-02-09 18:57:55 -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:

  • AWS DynamoDB
  • Aerospike
  • Azure Blob Storage
  • Azure CosmosDB
  • Azure Table Storage
  • Cassandra
  • Cloud Firestore (Datastore mode)
  • CloudState
  • Couchbase
  • Etcd
  • HashiCorp Consul
  • Hazelcast
  • Memcached
  • MongoDB
  • PostgreSQL
  • Redis
  • RethinkDB
  • SQL Server
  • Zookeeper

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 site for examples.