loadbalancer

package
v0.0.0-...-5c4b95d Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadBalancer

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

LoadBalancer contains a reference to an instance of ale's lb generic load balancing algorithm, and to the grpc server that will receive updates from the agents.

func StartLoadBalancer

func StartLoadBalancer(bindAddr string) (*LoadBalancer, error)

StartLoadBalancer is a constructor for LoadBalancer. It expects a bind address, and it returns a pointer to a LoadBalancer that is already started, and any error that was raised during the operation.

func (*LoadBalancer) SortGateways

func (l *LoadBalancer) SortGateways(
	sortedLocations []string,
	gateways []*models.Gateway) ([]*models.Gateway, error)

SortGateways is the main function that allows to use the load balancer for now. It receives an array of locations (already sorted by whatever criteria, like proximity), and it returns an array of `GatewayLoad` that already contains up-to-date load and overloaded information.

func (*LoadBalancer) Stop

func (l *LoadBalancer) Stop()

Stop does stop the underlying grpc server.

Jump to

Keyboard shortcuts

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