Documentation ¶
Index ¶
- type ChoiceOfBalancer
- func (b *ChoiceOfBalancer) Add(u *url.URL) error
- func (b *ChoiceOfBalancer) ConfiguredChoices() int
- func (b *ChoiceOfBalancer) ConfiguredRandomInt() string
- func (b *ChoiceOfBalancer) HighWatermark(u *url.URL) int
- func (b *ChoiceOfBalancer) NumberOfBalancees() int
- func (b *ChoiceOfBalancer) OutstandingRequests(u *url.URL) int
- func (b *ChoiceOfBalancer) Remove(u *url.URL) error
- func (b *ChoiceOfBalancer) RequestCount(u *url.URL) int
- func (b *ChoiceOfBalancer) ServeHTTP(w http.ResponseWriter, req *http.Request)
- type ChoiceOfBalancerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChoiceOfBalancer ¶
type ChoiceOfBalancer struct {
// contains filtered or unexported fields
}
ChoiceOfBalancer is a bookkeeping struct
func NewChoiceOfBalancer ¶
func NewChoiceOfBalancer(balancees []url.URL, options ChoiceOfBalancerOptions, next http.Handler) *ChoiceOfBalancer
NewChoiceOfBalancer gives a new ChoiceOfBalancer back
func (*ChoiceOfBalancer) Add ¶
func (b *ChoiceOfBalancer) Add(u *url.URL) error
Add a url to the loadbalancer
func (*ChoiceOfBalancer) ConfiguredChoices ¶
func (b *ChoiceOfBalancer) ConfiguredChoices() int
ConfiguredChoices returns the configured number of choices to randomly choose and then pick the best of
func (*ChoiceOfBalancer) ConfiguredRandomInt ¶
func (b *ChoiceOfBalancer) ConfiguredRandomInt() string
ConfiguredRandomInt returns the string representation of the random generator assigned to the balancee. Used for testing.
func (*ChoiceOfBalancer) HighWatermark ¶
func (b *ChoiceOfBalancer) HighWatermark(u *url.URL) int
HighWatermark returns the most outstanding requests for a particular balancee
func (*ChoiceOfBalancer) NumberOfBalancees ¶
func (b *ChoiceOfBalancer) NumberOfBalancees() int
NumberOfBalancees returns the number of balancees that this balancer knows about
func (*ChoiceOfBalancer) OutstandingRequests ¶
func (b *ChoiceOfBalancer) OutstandingRequests(u *url.URL) int
OutstandingRequests returns the number of outstanding requests for a particular balancee
func (*ChoiceOfBalancer) Remove ¶
func (b *ChoiceOfBalancer) Remove(u *url.URL) error
Remove a url from the loadbalancer.
func (*ChoiceOfBalancer) RequestCount ¶
func (b *ChoiceOfBalancer) RequestCount(u *url.URL) int
RequestCount gives back the number of requests that have come into a particular URL
func (*ChoiceOfBalancer) ServeHTTP ¶
func (b *ChoiceOfBalancer) ServeHTTP(w http.ResponseWriter, req *http.Request)