balancer

package
v0.0.0-...-a65126b Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

type Balancer interface {
	SelectWorker(r *http.Request, l *lambda.Lambda) (url.URL, *httputil.HttpError)
	ReleaseWorker(workerUrl url.URL)
	AddWorker(workerUrl url.URL)
	RemoveWorker(workerUrl url.URL)
	GetAllWorkers() []url.URL
}

func NewConsistentHashingBounded

func NewConsistentHashingBounded(workerUrls []url.URL) Balancer

func NewConsistentHashingBoundedFromJSONSlice

func NewConsistentHashingBoundedFromJSONSlice(jsonSlice []string) Balancer

func NewLeastLoaded

func NewLeastLoaded(workerUrls []url.URL) Balancer

func NewLeastLoadedFromJSONSlice

func NewLeastLoadedFromJSONSlice(jsonSlice []string) Balancer

func NewPackageAware

func NewPackageAware(workerUrls []url.URL, loadThreshold uint) Balancer

func NewPackageAwareFromJSONSlice

func NewPackageAwareFromJSONSlice(jsonSlice []string, loadThreshold uint) Balancer

func NewRandom

func NewRandom(workerNodes []worker.WeightedNode) Balancer

func NewRandomFromJSONSlice

func NewRandomFromJSONSlice(jsonSlice []string) Balancer

func NewRoundRobin

func NewRoundRobin(workerUrls []url.URL) Balancer

func NewRoundRobinFromJSONSlice

func NewRoundRobinFromJSONSlice(jsonSlice []string) Balancer

type ConsistentHashingBounded

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

func (ConsistentHashingBounded) AddWorker

func (b ConsistentHashingBounded) AddWorker(workerUrl url.URL)

func (*ConsistentHashingBounded) GetAllWorkers

func (b *ConsistentHashingBounded) GetAllWorkers() []url.URL

func (*ConsistentHashingBounded) ReleaseWorker

func (b *ConsistentHashingBounded) ReleaseWorker(workerUrl url.URL)

func (*ConsistentHashingBounded) RemoveWorker

func (b *ConsistentHashingBounded) RemoveWorker(workerUrl url.URL)

func (*ConsistentHashingBounded) SelectWorker

type LeastLoaded

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

func (*LeastLoaded) AddWorker

func (b *LeastLoaded) AddWorker(workerURL url.URL)

func (*LeastLoaded) GetAllWorkers

func (b *LeastLoaded) GetAllWorkers() []url.URL

func (*LeastLoaded) ReleaseWorker

func (b *LeastLoaded) ReleaseWorker(workerURL url.URL)

func (*LeastLoaded) RemoveWorker

func (b *LeastLoaded) RemoveWorker(targetURL url.URL)

func (*LeastLoaded) SelectWorker

func (b *LeastLoaded) SelectWorker(r *http.Request, l *lambda.Lambda) (url.URL, *httputil.HttpError)

type PackageAware

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

func (*PackageAware) AddWorker

func (b *PackageAware) AddWorker(workerUrl url.URL)

func (*PackageAware) GetAllWorkers

func (b *PackageAware) GetAllWorkers() []url.URL

func (*PackageAware) ReleaseWorker

func (b *PackageAware) ReleaseWorker(workerUrl url.URL)

func (*PackageAware) RemoveWorker

func (b *PackageAware) RemoveWorker(workerUrl url.URL)

func (*PackageAware) SelectWorker

func (b *PackageAware) SelectWorker(r *http.Request, l *lambda.Lambda) (url.URL, *httputil.HttpError)

type Random

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

Select a random worker

func (*Random) AddWorker

func (b *Random) AddWorker(workerURL url.URL)

func (*Random) GetAllWorkers

func (b *Random) GetAllWorkers() []url.URL

func (*Random) ReleaseWorker

func (b *Random) ReleaseWorker(workerURL url.URL)

func (*Random) RemoveWorker

func (b *Random) RemoveWorker(targetURL url.URL)

func (*Random) SelectWorker

func (b *Random) SelectWorker(r *http.Request, l *lambda.Lambda) (url.URL, *httputil.HttpError)

type RoundRobin

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

func (*RoundRobin) AddWorker

func (b *RoundRobin) AddWorker(workerURL url.URL)

func (*RoundRobin) GetAllWorkers

func (b *RoundRobin) GetAllWorkers() []url.URL

func (*RoundRobin) ReleaseWorker

func (b *RoundRobin) ReleaseWorker(workerURL url.URL)

func (*RoundRobin) RemoveWorker

func (b *RoundRobin) RemoveWorker(targetURL url.URL)

func (*RoundRobin) SelectWorker

func (b *RoundRobin) SelectWorker(r *http.Request, l *lambda.Lambda) (url.URL, *httputil.HttpError)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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