consistenthash

package
v0.0.0-...-3a9090c Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 3 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(data []byte) uint32

Hash 是一个函数类型,用于定义生成哈希值的函数

type Map

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

Map 结构体用于存储一致性哈希的相关信息

func New

func New(replicas int, fn Hash) *Map

New 函数用于创建一个新的一致性哈希Map

func (*Map) Add

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

Add 函数用于向一致性哈希中添加键

func (*Map) Get

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

Get 函数用于根据键获取对应的值

Jump to

Keyboard shortcuts

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