modulepackage
0.0.0-20201018042605-a601ea2299ee
Repository: https://github.com/crossmesh/sladder.git
Documentation: pkg.go.dev
# README
Sladder
Sladder is simple and embeded membership framework for service discovery and cluster management.
Model
Sladder provides an extensible cluster data model for node metadata exchange. Each node could has a set of key-value entries called metadata. Sladder ensures metadata consistent among all peers. Consistent strategy is tunable via different engines and validators.
Engines
Gossip engine are currently supported. It use an extended version of algorithm from 《SWIM: Scalable Weakly-consistent Infection-style Process Group Membership Protocol》. In CAP terms, gossip engine builds an AP system.
Etcd engine is in plan.
# Functions
MembershipModification creates an option to enable membership changing.
MostPossibleNode return the node whose names cover most of names in given set.
NewClusterWithNameResolver creates new cluster.
PreserveUnnamedNode is option indicating whether unnamed node should be preserved.
# Constants
EmptyNodeJoined tiggered after an empty node(with no name) joined cluster.
KeyDelete tiggered after a KeyValue was removed from a node.
KeyInsert tiggered after a KeyValue was inserted to a node.
LocalEntry will not be synced to remote.
NodeJoined tiggered after node name is resolved and the node joined cluster.
NodeRemoved tiggered after a node is removed from cluster.
UnknownEvent is undefined event.
ValueChanged tiggered after a KeyValue value changed.
# Variables
DefaultLogger implements defaule logging behaviours.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrTransactionCommitViolation raises when any operation breaks commit limitation.
No description provided by the author
No description provided by the author
# Structs
Cluster contains a set of node.
ClusterEventContext refers to event handler.
KeyValue stores one metadata key of the node.
KeyValueEntry holds KeyValue.
MockEngineInstance is an autogenerated mock type for the EngineInstance type.
MockKVValidator is an autogenerated mock type for the KVValidator type.
MockLogger is an autogenerated mock type for the Logger type.
MockNodeNameResolver is an autogenerated mock type for the NodeNameResolver type.
MockTxnCoordinator is an autogenerated mock type for the TxnCoordinator type.
Node represents members of cluster.
OperationContext traces operation scope.
StringTxn implements string KV transaction.
StringValidator implements basic string KV.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Transaction contains read/write operations on cluster.
TransactionOperation contains an operation trace within transaction.
WatchEventContext contains watch event context.
# Interfaces
ClusterOption contains cluster parameters.
Engine implements underlay membership protocol driver.
EngineInstance is live instance of engine.
EngineOption contains engine-specific parameters.
KeyChangeEventMetadata contains metadata of KeyChange event.
KeyDeleteEventMetadata contains metadata of KeyDelete event.
KeyInsertEventMetadata contains metadata of KeyInsert event.
KeyValueEventMetadata contains metadata of KeyValue-related event.
KVExtendedSyncer merges remote entry with extended merging properties.
KVMergingProperties contains extra properties for merging.
KVTransaction implements atomic operation.
KVTransactionWrapper wraps KVTransaction.
KVValidator guards consistency of KeyValue.
Logger is logging abstraction.
NodeNameResolver extracts node identifiers.
TxnCommitCoordinator traces transaction commit.
TxnCoordinator traces transaction.
TxnKVCoordinator traces Transaction.KV().
TxnOption contains extra requirements for a transaction.
TxnRollbackCoordinator traces transaction rollback.
TxnStartCoordinator traces start of transaction.
# Type aliases
ClusterEventHandler receives events of cluster.
Errors contains a set of errors.
Event is enum type of event in cluster scope.
WatchEventHandler handles watch event.