LoadBalancer

package
v0.0.0-...-99d94e9 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT 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 {
	Strategy            LoadBalancerStrategy
	ServerList          []*ServerPkg.Server
	HealthCheckInterval int
}

func NewLoadBalancer

func NewLoadBalancer(serverUrls []string, healthCheckInterval int, weights []int, strategyType int) *LoadBalancer

func (*LoadBalancer) HealthCheck

func (lb *LoadBalancer) HealthCheck()

func (*LoadBalancer) ServeHTTP

func (lb *LoadBalancer) ServeHTTP(w http.ResponseWriter, r *http.Request)

type LoadBalancerStrategy

type LoadBalancerStrategy interface {
	// contains filtered or unexported methods
}

type RoundRobinLoadBalancer

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

type StickyRoundRobin

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

type WeightedRoundRobin

type WeightedRoundRobin struct {
	WeightedServerList []*ServerPkg.Server
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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