hash

package
v1.17.5 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fnv32

func Fnv32(key string) int

func HashString

func HashString(in string) uint

Types

type Bucket

type Bucket struct {
	Host   string
	Weight uint32
}

Bucket single bucket of hash ring

type Continuum

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

Continuum consistent hash ring

func New

func New(buckets map[Bucket]bool) *Continuum

New hash ring

func (*Continuum) Hash

func (c *Continuum) Hash(h uint) string

Hash hash string to lookup node

Jump to

Keyboard shortcuts

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