balancer

package
v0.0.0-...-dd9b67b Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2014 License: BSD-3-Clause, MIT Imports: 4 Imported by: 0

Documentation

Overview

package balancer provides reference implementations for common load balancing techniques across service sets.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoServices = errors.New("balancer: no services found")

Functions

This section is empty.

Types

type LoadBalancer

type LoadBalancer interface {
	Next() (*discoverd.Service, error)
}

func Random

func Random(set discoverd.ServiceSet, source rand.Source) LoadBalancer

Random returns a LoadBalancer that selects random services using a rand.Rand with source as the source. If source is nil, the default will be used.

func RoundRobin

func RoundRobin(set discoverd.ServiceSet) LoadBalancer

RoundRobin returns a LoadBalancer that selects services in the order they appear in the service set.

Jump to

Keyboard shortcuts

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