consistenthash

package
v0.0.0-...-cde7289 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

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

func New

func New(opts ...Option) *Hash

func (*Hash) Add

func (h *Hash) Add(nodes ...string)

func (*Hash) Get

func (h *Hash) Get(key string) string

func (*Hash) Name

func (h *Hash) Name() string

type HashFunc

type HashFunc func(data []byte) uint32

type Option

type Option struct {
	F func(o *Options)
}

func WithHashFunc

func WithHashFunc(hashFunc HashFunc) Option

func WithReplicationFactor

func WithReplicationFactor(num int) Option

type Options

type Options struct {
	HashFunc          HashFunc
	ReplicationFactor int
}

Jump to

Keyboard shortcuts

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