Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAddExceedsRingSize = errors.New("cannot add a new node, new size will exceed maximum ring size") ErrNodeNotFound = errors.New("node not found") )
Errors relating to common ring issues when handling nodes.
Functions ¶
This section is empty.
Types ¶
type Ring ¶
Ring represents a circular ring that stores the provided nodes. The ring size is set to len(nodes) << 3.
func New ¶
New will take in a slice of nodes and placed them in ascending order on the network ring.
func (*Ring) Add ¶
Add will add a new node into the ring, if the new size would exceed the ring size the function will return an error rather than increase the size creating a full rehash requirement on all nodes.
Click to show internal directories.
Click to hide internal directories.