consistenthash

package
v0.0.0-...-15722f1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsistentHash

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

func NewConsistentHash

func NewConsistentHash(replicas int, hash Hash) *ConsistentHash

func (*ConsistentHash) AddTruthNode

func (ch *ConsistentHash) AddTruthNode(nodes ...string)

func (*ConsistentHash) GetTruthNode

func (ch *ConsistentHash) GetTruthNode(key string) string

选择真实节点

func (*ConsistentHash) RemovePeer

func (ch *ConsistentHash) RemovePeer(peer string)

type Hash

type Hash func(data []byte) uint32

Jump to

Keyboard shortcuts

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