ketama

package
v0.0.0-...-ee0865d Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TODO you can modify this get more virtual node
	Base = 255
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HashRing

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

func NewRing

func NewRing(n int) (h *HashRing)

func (*HashRing) AddNode

func (h *HashRing) AddNode(n string, s int)

Adds a new node to a hash ring n: name of the server s: multiplier for default number of ticks (useful when one cache node has more resources, like RAM, than another)

func (*HashRing) Bake

func (h *HashRing) Bake()

func (*HashRing) Hash

func (h *HashRing) Hash(s string) string

Jump to

Keyboard shortcuts

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