hashring

package
v0.0.0-...-2bc610f Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2017 License: GPL-3.0 Imports: 3 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(key []byte) uint32

Hash ...

type Hashring

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

Hashring ...

func NewHashring

func NewHashring(replicas int, hash Hash) *Hashring

NewHashring ...

func (*Hashring) AddNode

func (h *Hashring) AddNode(n Node)

AddNode ...

func (*Hashring) GetNode

func (h *Hashring) GetNode(data string) (Node, bool)

GetNode ...

func (*Hashring) IsEmpty

func (h *Hashring) IsEmpty() bool

IsEmpty ...

func (*Hashring) RemoveNode

func (h *Hashring) RemoveNode(n Node)

RemoveNode ...

type Keys

type Keys []key

Keys ...

func (Keys) Len

func (ks Keys) Len() int

Len ...

func (Keys) Less

func (ks Keys) Less(i, j int) bool

Less ...

func (Keys) Swap

func (ks Keys) Swap(i, j int)

Swap ...

type Node

type Node struct {
	ID int
}

Node ...

func NewNode

func NewNode(id int) Node

NewNode ...

Jump to

Keyboard shortcuts

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