hashkit

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const KetamaPointsPerServer = 160

Variables

This section is empty.

Functions

func Fnv1a64

func Fnv1a64(key []byte) uint32

Types

type Continuum

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

func NewKetama

func NewKetama(servers []*Server, hashFn func(key []byte) uint32) *Continuum

func (*Continuum) Dispatch

func (c *Continuum) Dispatch(key string) uint32

func (*Continuum) Rebuild

func (c *Continuum) Rebuild(servers []*Server)

type HashKit

type HashKit interface {
	Dispatch(key string) uint32
	Rebuild(servers []*Server)
}

type Server

type Server struct {
	Name   string
	Weight int64
	Index  uint32
}

Jump to

Keyboard shortcuts

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