hashring

package
v0.0.0-...-af5906d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashRing

type HashRing[Node constraints.Ordered] struct {
	// contains filtered or unexported fields
}

func New

func New[Node constraints.Ordered](replicas int) *HashRing[Node]

func (*HashRing[Node]) AddNodes

func (hr *HashRing[Node]) AddNodes(nodes ...Node) *HashRing[Node]

func (*HashRing[Node]) GetNode

func (hr *HashRing[Node]) GetNode(key Node) (n Node)

GetNode returns the node that a given key maps to

func (*HashRing[Node]) RemoveNodes

func (hr *HashRing[Node]) RemoveNodes(nodes ...Node)

func (*HashRing[Node]) ResetNodes

func (hr *HashRing[Node]) ResetNodes(nodes ...Node)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL