loadbalancer

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	URL   *url.URL
	Alive bool

	ReverseProxy *httputil.ReverseProxy
	// contains filtered or unexported fields
}

func (*Backend) IsAlive

func (b *Backend) IsAlive() (alive bool)

IsAlive returns true when backend is alive

func (*Backend) SetAlive

func (b *Backend) SetAlive(alive bool)

SetAlive for this backend

type LoadBalancer

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

func (*LoadBalancer) Run

func (a *LoadBalancer) Run(host, port string)

type ServerPool

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

func (*ServerPool) AddBackend

func (s *ServerPool) AddBackend(backend *Backend)

func (*ServerPool) GetNextPeer

func (s *ServerPool) GetNextPeer() *Backend

func (*ServerPool) NextIndex

func (s *ServerPool) NextIndex() int

Jump to

Keyboard shortcuts

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