Documentation ¶
Overview ¶
Package local provides a master-slave implementation to run on a local machine.
Index ¶
- type Master
- func (master *Master) Assist(p lib.Master) error
- func (master *Master) Cluster() ([]lib.Node, error)
- func (master *Master) ClusterGroup(hash int) []int
- func (master *Master) Join(p lib.Node) error
- func (master *Master) Listen() error
- func (master *Master) Read(key string) (string, lib.Revision, error)
- func (master *Master) Rebuild() error
- func (master *Master) Replicas() ([]lib.Master, error)
- func (master *Master) Role() (lib.Role, error)
- func (master *Master) Store(key, value string, rev lib.Revision) error
- type Node
- type Slave
- func (slave *Slave) Address() string
- func (slave *Slave) Keys() ([]string, error)
- func (slave *Slave) Listen() error
- func (slave *Slave) LocalKeys() ([]string, error)
- func (slave *Slave) LocalRead(key string) (string, lib.Revision, error)
- func (slave *Slave) LocalStore(key, value string, rev lib.Revision) error
- func (slave *Slave) Mirror(peers []lib.Node) error
- func (slave *Slave) Read(key string) (string, lib.Revision, error)
- func (slave *Slave) Rebuild() error
- func (slave *Slave) Revision(rev lib.Revision) (lib.Revision, error)
- func (slave *Slave) Role() (lib.Role, error)
- func (slave *Slave) Shutdown() error
- func (slave *Slave) Status() lib.Status
- func (slave *Slave) Store(key, value string, rev lib.Revision) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Master ¶
Master is a local master runtime.
func (*Master) Assist ¶
Assist puts the peer node in the replica set and notifies the other cluster masters.
func (*Master) ClusterGroup ¶
ClusterGroup returns the ids of the nodes addressed by the hash.
func (*Master) Join ¶
Join puts the peer node in the cluster set, requests it to mirror one of its group peers and notifies the other masters in the replica set.
type Node ¶
type Node interface {
Listen() error
}
Node is a local node that can listen for incoming connections.
type Slave ¶
type Slave struct { PublicAddress string ReplicaSet replicas.Set Latest lib.Revision KeepAlive bool Entries hashtable.Map NodeStatus lib.Status }
Slave is a local slave runtime.
func (*Slave) LocalStore ¶
LocalStore stores the key-value pair locally.
Directories ¶
Path | Synopsis |
---|---|
Package cluster provides functionality for managing node cluster sets.
|
Package cluster provides functionality for managing node cluster sets. |
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. |
Package replicas provides functionality to manage master node sets.
|
Package replicas provides functionality to manage master node sets. |
Click to show internal directories.
Click to hide internal directories.