lb

package
v0.0.0-...-d3ed2aa Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ROUNDROBIN round robin
	ROUNDROBIN = "ROUNDROBIN"
)

Variables

View Source
var (
	// LBS map loadBalance name and process function
	LBS = map[string]func() LoadBalance{
		ROUNDROBIN: NewRoundRobin,
	}
)

Functions

func GetSupportLBS

func GetSupportLBS() []string

GetSupportLBS return supported loadBalances

Types

type LoadBalance

type LoadBalance interface {
	Select(req *fasthttp.Request, servers *list.List) int
}

LoadBalance loadBalance interface

func NewLoadBalance

func NewLoadBalance(name string) LoadBalance

NewLoadBalance create a LoadBalance

func NewRoundRobin

func NewRoundRobin() LoadBalance

NewRoundRobin create a RoundRobin

type RoundRobin

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

RoundRobin round robin loadBalance impl

func (RoundRobin) Select

func (rr RoundRobin) Select(req *fasthttp.Request, servers *list.List) int

Select select a server from servers using RoundRobin

Jump to

Keyboard shortcuts

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