consistent

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package consistent implements consistent hashing for cache nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashBucket

func HashBucket(key any, buckets int, previousBuckets ...int) (int, error)

HashBucket returns a bucket from [0,buckets). If you want to implement a retry, you can pass previousBuckets, which indicates buckets which must be avoided in the output. HashBucket will modify the previousBuckets slice by sorting it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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