consistent

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashRing

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

func NewHashRing

func NewHashRing(nodes []string, numberOfReplicas ...int) *HashRing

func (HashRing) GetNode

func (this HashRing) GetNode(pk string) (string, error)

func (*HashRing) SetNodes

func (this *HashRing) SetNodes(nodes []string)

func (*HashRing) SetNumberOfReplicas

func (this *HashRing) SetNumberOfReplicas(num int)

func (HashRing) Stats

func (this HashRing) Stats() map[string]*Stat

type Stat

type Stat struct {
	sync.RWMutex
	TotalHit int
	KeyHit   map[string]int
}

func (Stat) String

func (s Stat) String() string

Jump to

Keyboard shortcuts

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