consistenthash

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: Apache-2.0 Imports: 5 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 将字节映射到uint32

type Map

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

func New

func New(replicas int, fn Hash) *Map

New creates a Map instance

func (*Map) Add

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

Add 添加一些键。

func (*Map) Del

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

Dle 删除一些键。

func (*Map) Get

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

Get 获取哈希中与提供的键最接近的项

func (*Map) String

func (m *Map) String() string

Jump to

Keyboard shortcuts

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