balancer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

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

Balancer is the main data struct for the load balancer

func New

func New(startVIP, toConnect net.IP, capacity, readTimeout, writeTimeout int) (*Balancer, error)

New creates new Balancer. Throws error if capacity is not prime

func NewTest

func NewTest(startVIP, toConnect net.IP, capacity, readTimeout, writeTimeout int) (*Balancer, error)

NewTest creates new Balancer with the testing flag on

func (*Balancer) Start

func (b *Balancer) Start() error

Start attaches the VIP and starts the load balancer

func (*Balancer) Stop

func (b *Balancer) Stop() error

Stop stops the currently running lb by appending onto `stop`

func (*Balancer) WaitForUnlock

func (b *Balancer) WaitForUnlock()

WaitForUnlock waits until the mutex lock is freed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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