consistenthash

package
v0.0.0-...-9d41389 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 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

type Map

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

func NewMap

func NewMap(replicas int, hash Hash) *Map

func (*Map) Add

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

添加真实节点到map中,每个key对应一个真实节点 Add adds some keys yo the testHashMap

func (*Map) Get

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

Get gets the closest item in the testHashMap to the provided key

Jump to

Keyboard shortcuts

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