hashring

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHashFunc

func DefaultHashFunc(key string) (int, error)

func SliceEquals

func SliceEquals(slice1 []string, slice2 []string) bool

SliceEquals checks for order independent equality

Types

type HashFunc

type HashFunc func(key string) (int, error)

type Opt

type Opt struct {
	Members      []string
	VirtualNodes int
	HashFunc     func(key string) (int, error)
}

type Ring

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

func New

func New(opt Opt) (*Ring, error)

func (*Ring) GetOwner

func (r *Ring) GetOwner(key string) (string, error)

func (*Ring) Members

func (r *Ring) Members() []string

func (*Ring) Points

func (r *Ring) Points() []int

func (*Ring) SetMembers

func (r *Ring) SetMembers(newMembers []string) error

func (*Ring) VirtualNodes

func (r *Ring) VirtualNodes() int

Jump to

Keyboard shortcuts

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