liblb

package module
v0.0.0-...-2321f9d Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2017 License: MIT Imports: 1 Imported by: 4

README

liblb

A golang library that implements load balancing algorithms. Still a work in progress!

https://godoc.org/github.com/lafikl/liblb

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoHost = errors.New("host not found")

Functions

This section is empty.

Types

type Balancer

type Balancer interface {
	New(hosts ...string)
	Add(host string)
	Remove(host string)
	Balance() (string, error)
}

type KeyedBalancer

type KeyedBalancer interface {
	New(hosts ...string)
	Add(host string)
	Remove(host string)
	Balance(key string) (string, error)
}

Directories

Path Synopsis
Bounded is Consistent hashing with bounded loads.
Bounded is Consistent hashing with bounded loads.
Consistent uses consistent hashing algorithm to assign work to hosts.
Consistent uses consistent hashing algorithm to assign work to hosts.
P2C will distribute the traffic by choosing two hosts either via hashing or randomly and then pick the least loaded of the two.
P2C will distribute the traffic by choosing two hosts either via hashing or randomly and then pick the least loaded of the two.
R2 is a concurrency-safe Round-Robin Balancer.
R2 is a concurrency-safe Round-Robin Balancer.

Jump to

Keyboard shortcuts

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