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.