hash

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...lbapi.Opt) lbapi.Balancer

New make a new load-balancer instance with Ketama Hashing algorithm

func WithHashFunc

func WithHashFunc(hashFunc Hasher) lbapi.Opt

WithHashFunc allows a custom hash function to be specified. The default Hasher hash func is crc32.ChecksumIEEE.

func WithReplica

func WithReplica(replica int) lbapi.Opt

WithReplica allows a custom replica number to be specified. The default replica number is 32.

Types

type Hasher

type Hasher func(data []byte) uint32

Hasher is a hash function

Jump to

Keyboard shortcuts

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