ketama

package
v0.0.0-...-440800f Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultReplicas = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HashFunc

type HashFunc func(data []byte) uint32

type Ketama

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

func NewKetama

func NewKetama(replicas int, fn HashFunc) *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)

Jump to

Keyboard shortcuts

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