Documentation ¶
Overview ¶
Package store provides a simple distributed key-value store. The keys and associated values are changed via distributed consensus, meaning that the values are changed only when a majority of nodes in the cluster agree on the new value.
Distributed consensus is provided via the Raft algorithm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemDatastore ¶
type InMemDatastore struct {
// contains filtered or unexported fields
}
The key-value store for the system.
func NewInMemDatastore ¶
func NewInMemDatastore() *InMemDatastore
func (*InMemDatastore) Delete ¶
func (im *InMemDatastore) Delete(key string) error
func (*InMemDatastore) Set ¶
func (im *InMemDatastore) Set(key, value string) error
func (*InMemDatastore) Snapshot ¶
func (im *InMemDatastore) Snapshot() *InMemDatastore
Clone datastore by copying current data to a new instance and return the new instance
type Store ¶
Store is a simple key-value store, where all changes are made via Raft consensus.
func (*Store) Join ¶
Join joins a node, located at addr, to this store. The node must be ready to respond to Raft communications at that address.
Click to show internal directories.
Click to hide internal directories.