hrw

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

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

Go to latest
Published: Apr 15, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

README

hrw

Rendezvous or highest random weight (HRW) hashing

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Name   string
	Weight float64
}

type Nodes

type Nodes map[string]nodeInfo

mapping on nodes: Name -> Weight

func New

func New(nodesList []Node) Nodes

func (Nodes) AddNode

func (hrw Nodes) AddNode(node Node) error

func (Nodes) GetAllNodes

func (hrw Nodes) GetAllNodes() []string

func (Nodes) GetNode

func (hrw Nodes) GetNode(key string) string

func (Nodes) GetNodesRanked

func (hrw Nodes) GetNodesRanked(key string) []string

func (Nodes) NodesCount

func (hrw Nodes) NodesCount() int

func (Nodes) RemoveNode

func (hrw Nodes) RemoveNode(node string) error

Jump to

Keyboard shortcuts

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