hash

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

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

Go to latest
Published: Sep 10, 2018 License: MIT Imports: 4 Imported by: 0

README

golang版一致性哈希

Documentation

Index

Constants

View Source
const VirtualNodesFactor = 256

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsistentHash

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

func NewConsistentHash

func NewConsistentHash() *ConsistentHash

func (*ConsistentHash) Add

func (c *ConsistentHash) Add(nk string, nd interface{}, nw uint) bool

func (*ConsistentHash) Get

func (c *ConsistentHash) Get(key string) *node

func (*ConsistentHash) Remove

func (c *ConsistentHash) Remove(key string)

Jump to

Keyboard shortcuts

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