balancer

package
v0.0.0-...-e6f5e3b Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 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 Balance

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

func NewBalance

func NewBalance(config Config) *Balance

Creates and returns a new balancer with the given config

func (*Balance) AddNode

func (b *Balance) AddNode(node string)

func (*Balance) FindNode

func (b *Balance) FindNode(key string) interface{}

func (*Balance) RemoveNode

func (b *Balance) RemoveNode(n string)

type Config

type Config struct {
	Hasher Hasher
	// contains filtered or unexported fields
}

type Entity

type Entity struct {
	Name string
}

type Hasher

type Hasher interface {
	Hash([]byte) uint64
}

Hashing algorithm interface, implement this interface to use as a hasher

type XxHash

type XxHash struct{}

func (*XxHash) Hash

func (x *XxHash) Hash(str []byte) uint64

Jump to

Keyboard shortcuts

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