liblb: github.com/lafikl/liblb Index | Files | Directories

package liblb

import "github.com/lafikl/liblb"

Index

Package Files

liblb.go

Variables

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

type Balancer Uses

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

type KeyedBalancer Uses

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

Directories

PathSynopsis
boundedBounded is Consistent hashing with bounded loads.
consistentConsistent uses consistent hashing algorithm to assign work to hosts.
murmur
p2cP2C will distribute the traffic by choosing two hosts either via hashing or randomly and then pick the least loaded of the two.
r2R2 is a concurrency-safe Round-Robin Balancer.

Package liblb imports 1 packages (graph) and is imported by 4 packages. Updated 2017-09-14. Refresh now. Tools for package owners.