consistenthash

package module
v0.0.0-...-f15fc2e Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: MIT Imports: 5 Imported by: 0

README

Consistent Hash

Consistent Hashing (Hashring Implementation) package for Golang.

https://en.wikipedia.org/wiki/Consistent_hashing

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 HashRing

type HashRing struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRing

func NewRing(fn Hash) *HashRing

func (*HashRing) AddNode

func (h *HashRing) AddNode(key string, weight int) error

func (*HashRing) DeleteNode

func (h *HashRing) DeleteNode(key string) error

func (*HashRing) Get

func (h *HashRing) Get(key string) (string, error)

func (*HashRing) IsEmpty

func (h *HashRing) IsEmpty() bool

type StringValue

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

Jump to

Keyboard shortcuts

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