README

liblb

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

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

Expand ▾ Collapse ▴

Documentation

Index

Constants

This section is empty.

Variables

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)
}

Source Files

Directories

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