Documentation ¶
Index ¶
- type RandomBalancer
- func (b *RandomBalancer) Add(u *url.URL) error
- func (b *RandomBalancer) ConfiguredRandomInt() string
- func (b *RandomBalancer) NumberOfBalancees() int
- func (b *RandomBalancer) Remove(u *url.URL) error
- func (b *RandomBalancer) RequestCount(u *url.URL) int
- func (b *RandomBalancer) ServeHTTP(w http.ResponseWriter, req *http.Request)
- type RandomBalancerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RandomBalancer ¶
type RandomBalancer struct {
// contains filtered or unexported fields
}
func NewRandomBalancer ¶
func NewRandomBalancer(balancees []url.URL, options RandomBalancerOptions, next http.Handler) *RandomBalancer
NewRandomBalancer gives a new ChoiceOfBalancer back
func (*RandomBalancer) Add ¶
func (b *RandomBalancer) Add(u *url.URL) error
Add a url to the loadbalancer
func (*RandomBalancer) ConfiguredRandomInt ¶
func (b *RandomBalancer) ConfiguredRandomInt() string
ConfiguredRandomInt returns the string representation of the random generator assigned to the balancee. Used for testing.
func (*RandomBalancer) NumberOfBalancees ¶
func (b *RandomBalancer) NumberOfBalancees() int
NumberOfBalancees returns the number of balancees that this balancer knows about
func (*RandomBalancer) Remove ¶
func (b *RandomBalancer) Remove(u *url.URL) error
Remove a url from the loadbalancer.
func (*RandomBalancer) RequestCount ¶
func (b *RandomBalancer) RequestCount(u *url.URL) int
RequestCount gives back the number of requests that have come into a particular URL
func (*RandomBalancer) ServeHTTP ¶
func (b *RandomBalancer) ServeHTTP(w http.ResponseWriter, req *http.Request)
type RandomBalancerOptions ¶
Click to show internal directories.
Click to hide internal directories.