consistenthash

package
v0.0.0-...-c13f88c Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 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 HashFunc

type HashFunc func(data []byte) uint32

hash算法,外部提供

type Map

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

func New

func New(replics int, hash HashFunc) *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