Documentation ¶
Overview ¶
Package lib provides a collection of types and methods to run a key-value storage compatible to the dkvs specification.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Master ¶
type Master interface { Node // Cluster collects all to this master connected nodes. Cluster() ([]Node, error) // Replicas collects all master replicas in this cluster. Replicas() ([]Master, error) // Join tells this master than the node wants to join its cluster. Join(n Node) error // Assist tells this master that another secondary master wants to join its cluster. Assist(m Master) error }
Master is a superset of a cluster node with administrative abilities.
type Node ¶
type Node interface { // Read searches the value and revision mapped to the key. Read(key string) (string, Revision, error) // Store puts the key-value pair in the data store. Store(key, value string, rev Revision) error // Keys collects all keys mapped to values. Keys() ([]string, error) // Mirror collects all key-value pairs from the peers and stores them locally. Mirror([]Node) error // Revision updates the internal revision and always returns the latest revision. Revision(rev Revision) (Revision, error) // Address returns this node's address. Address() string // Role returns the node's role. Role() (Role, error) // Rebuild forces the node to refetch master replicas and cluster nodes. Rebuild() error // Status returns the current actor state of the node. Status() Status // Shutdown stops the node. Shutdown() error // LocalKeys collects all local keys that are mapped to values. LocalKeys() ([]string, error) // LocalRead searches locally for the value-revision pair mapped to the key. LocalRead(key string) (string, Revision, error) // LocalStore puts the key-value pair in the local key store. LocalStore(key, value string, rev Revision) error }
Node is a part of a DKVS cluster.
type Revision ¶
type Revision []byte
Revision stores a byte-encoded versioning ID.
func ToRevision ¶
ToRevision converts the string into a revision ID.
Directories ¶
Path | Synopsis |
---|---|
Package local provides a master-slave implementation to run on a local machine.
|
Package local provides a master-slave implementation to run on a local machine. |
cluster
Package cluster provides functionality for managing node cluster sets.
|
Package cluster provides functionality for managing node cluster sets. |
hashtable
Package hashtable provides functionality for storing and retrieving key-value pairs associated with a specific revision.
|
Package hashtable provides functionality for storing and retrieving key-value pairs associated with a specific revision. |
replicas
Package replicas provides functionality to manage master node sets.
|
Package replicas provides functionality to manage master node sets. |
Package remote provides a remote interface for network nodes.
|
Package remote provides a remote interface for network nodes. |
Click to show internal directories.
Click to hide internal directories.