Documentation ¶
Index ¶
- type Node
- type NodeManager
- func (m *NodeManager[T]) Add(node *Node[T])
- func (m *NodeManager[T]) Count() int
- func (m *NodeManager[T]) FindNext(key string, num int) []hashring.Slot[T]
- func (m *NodeManager[T]) FindOne(key string) (hashring.Slot[T], bool)
- func (m *NodeManager[T]) FindPrev(key string, num int) []hashring.Slot[T]
- func (m *NodeManager[T]) GetNode(key string) (*Node[T], bool)
- func (m *NodeManager[T]) GetNodes() []Node[T]
- func (m *NodeManager[T]) Remove(nodeKey string)
- func (m *NodeManager[T]) Slots() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node[T any] struct { Data T // contains filtered or unexported fields }
func (*Node[T]) VirtualKeys ¶ added in v1.0.2
VirtualKeys returns virtual keys
type NodeManager ¶
type NodeManager[T any] struct { // contains filtered or unexported fields }
func NewManager ¶
func NewManager[T any](replicas int) *NodeManager[T]
func (*NodeManager[T]) Count ¶
func (m *NodeManager[T]) Count() int
Count returns manager nodes count
func (*NodeManager[T]) FindNext ¶
func (m *NodeManager[T]) FindNext(key string, num int) []hashring.Slot[T]
FindNext returns hashring slots by key and next num
func (*NodeManager[T]) FindOne ¶
func (m *NodeManager[T]) FindOne(key string) (hashring.Slot[T], bool)
FindOne returns hashring slot by key
func (*NodeManager[T]) FindPrev ¶
func (m *NodeManager[T]) FindPrev(key string, num int) []hashring.Slot[T]
FindPrev returns hashring slots by key and prev num
func (*NodeManager[T]) GetNode ¶
func (m *NodeManager[T]) GetNode(key string) (*Node[T], bool)
GetNode returns manager node
func (*NodeManager[T]) GetNodes ¶
func (m *NodeManager[T]) GetNodes() []Node[T]
GetNodes returns total manager nodes
func (*NodeManager[T]) Slots ¶
func (m *NodeManager[T]) Slots() int
Slots returns hashring slots count
Click to show internal directories.
Click to hide internal directories.