Documentation ¶
Index ¶
- type Balancer
- func NewConsistentHashingBounded(workerUrls []url.URL) Balancer
- func NewConsistentHashingBoundedFromJSONSlice(jsonSlice []string) Balancer
- func NewLeastLoaded(workerUrls []url.URL) Balancer
- func NewLeastLoadedFromJSONSlice(jsonSlice []string) Balancer
- func NewPackageAware(workerUrls []url.URL, loadThreshold uint) Balancer
- func NewPackageAwareFromJSONSlice(jsonSlice []string, loadThreshold uint) Balancer
- func NewRandom(workerNodes []worker.WeightedNode) Balancer
- func NewRandomFromJSONSlice(jsonSlice []string) Balancer
- func NewRoundRobin(workerUrls []url.URL) Balancer
- func NewRoundRobinFromJSONSlice(jsonSlice []string) Balancer
- type ConsistentHashingBounded
- func (b ConsistentHashingBounded) AddWorker(workerUrl url.URL)
- func (b *ConsistentHashingBounded) GetAllWorkers() []url.URL
- func (b *ConsistentHashingBounded) ReleaseWorker(workerUrl url.URL)
- func (b *ConsistentHashingBounded) RemoveWorker(workerUrl url.URL)
- func (b *ConsistentHashingBounded) SelectWorker(r *http.Request, l *lambda.Lambda) (url.URL, *httputil.HttpError)
- type LeastLoaded
- func (b *LeastLoaded) AddWorker(workerURL url.URL)
- func (b *LeastLoaded) GetAllWorkers() []url.URL
- func (b *LeastLoaded) ReleaseWorker(workerURL url.URL)
- func (b *LeastLoaded) RemoveWorker(targetURL url.URL)
- func (b *LeastLoaded) SelectWorker(r *http.Request, l *lambda.Lambda) (url.URL, *httputil.HttpError)
- type PackageAware
- func (b *PackageAware) AddWorker(workerUrl url.URL)
- func (b *PackageAware) GetAllWorkers() []url.URL
- func (b *PackageAware) ReleaseWorker(workerUrl url.URL)
- func (b *PackageAware) RemoveWorker(workerUrl url.URL)
- func (b *PackageAware) SelectWorker(r *http.Request, l *lambda.Lambda) (url.URL, *httputil.HttpError)
- type Random
- type RoundRobin
- func (b *RoundRobin) AddWorker(workerURL url.URL)
- func (b *RoundRobin) GetAllWorkers() []url.URL
- func (b *RoundRobin) ReleaseWorker(workerURL url.URL)
- func (b *RoundRobin) RemoveWorker(targetURL url.URL)
- func (b *RoundRobin) SelectWorker(r *http.Request, l *lambda.Lambda) (url.URL, *httputil.HttpError)
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 NewLeastLoaded ¶
func NewRandom ¶
func NewRandom(workerNodes []worker.WeightedNode) Balancer
func NewRandomFromJSONSlice ¶
func NewRoundRobin ¶
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)
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)
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)
type Random ¶
type Random struct {
// contains filtered or unexported fields
}
Select a random worker
func (*Random) GetAllWorkers ¶
func (*Random) ReleaseWorker ¶
func (*Random) RemoveWorker ¶
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)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.