consistenthash

package
v0.0.0-...-977b0b9 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash func([]byte) uint32

type Map

type Map struct {
	// contains filtered or unexported fields
}

存储所有的hash keys

func New

func New(replicas int, fn Hash) *Map

创建Map实例

func (*Map) Add

func (m *Map) Add(keys ...string)

添加真实节点的方法

func (*Map) Get

func (m *Map) Get(key string) string

得到输入key值对应的真实节点名称

Jump to

Keyboard shortcuts

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