consistent_hash

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

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

Go to latest
Published: Jun 1, 2016 License: MIT Imports: 5 Imported by: 0

README

一致性哈希

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoNode           = errors.New("no node exist")
	ErrNodeAlreadyExist = errors.New("node already exist")
	ErrNodeNotFound     = errors.New("node not found")
)

Functions

This section is empty.

Types

type ConsistentHash

type ConsistentHash interface {
	Exist(node string) bool
	Add(node string) error
	Remove(node string) error
	Get(key string) (string, error)
	Nodes() []string
	Clear()
}

func Default

func Default() ConsistentHash

func New

func New(virutalMultis int) ConsistentHash

Jump to

Keyboard shortcuts

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