consistenthash

package
v0.0.0-...-052b702 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT 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(data []byte) uint32 // Store only positive numbers

type Map

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

Map type.

func New

func New(replicas int, fn Hash) *Map

Initializer of Map

func (*Map) Add

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

Modify Map and add varible string of keys to hashMap.

func (*Map) Get

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

Map given key to a specific node

Jump to

Keyboard shortcuts

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