ketama

package
v0.0.0-...-037b315 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultReplicas = 2999
	Salt            = "n*@if09^Ig3h"
)

Variables

This section is empty.

Functions

func DefaultHash

func DefaultHash(data []byte) uint32

Types

type HashFunc

type HashFunc func(data []byte) uint32

type Ketama

type Ketama struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Ketama

func (*Ketama) Add

func (h *Ketama) Add(nodes ...string)

func (*Ketama) Get

func (h *Ketama) Get(key string) (string, bool)

func (*Ketama) IsEmpty

func (h *Ketama) IsEmpty() bool

func (*Ketama) Remove

func (h *Ketama) Remove(nodes ...string)

type Option

type Option func(k *Ketama)

func Hash

func Hash(fn HashFunc) Option

func Replicas

func Replicas(r int) Option

Jump to

Keyboard shortcuts

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