Versions in this module Expand all Collapse all v0 v0.1.1 Dec 7, 2014 v0.1.0 Dec 7, 2014 Changes in this version + const FSMGrowFactor + const FSMMaxWeight + type EndpointOptions struct + Meter metrics.FailRateMeter + Weight int + type EndpointWeight struct + Endpoint *WeightedEndpoint + Weight int + func (ew *EndpointWeight) GetEndpoint() *WeightedEndpoint + func (ew *EndpointWeight) GetWeight() int + func (ew *EndpointWeight) SetWeight(w int) + type FSMHandler struct + func NewFSMHandler() (*FSMHandler, error) + func NewFSMHandlerWithOptions(timeProvider timetools.TimeProvider) (*FSMHandler, error) + func (fsm *FSMHandler) AdjustWeights() ([]SuggestedWeight, error) + func (fsm *FSMHandler) Init(endpoints []*WeightedEndpoint) + type FailureHandler interface + AdjustWeights func() ([]SuggestedWeight, error) + Init func(endpoints []*WeightedEndpoint) + type Options struct + FailureHandler FailureHandler + TimeProvider timetools.TimeProvider + type RoundRobin struct + func NewRoundRobin() (*RoundRobin, error) + func NewRoundRobinWithOptions(o Options) (*RoundRobin, error) + func (r *RoundRobin) AddEndpointWithOptions(endpoint endpoint.Endpoint, options EndpointOptions) error + func (r *RoundRobin) FindEndpointById(id string) *WeightedEndpoint + func (r *RoundRobin) FindEndpointByUrl(url string) *WeightedEndpoint + func (r *RoundRobin) GetEndpoints() []*WeightedEndpoint + func (r *RoundRobin) NextEndpoint(req request.Request) (endpoint.Endpoint, error) + func (r *RoundRobin) RemoveEndpoint(endpoint endpoint.Endpoint) error + func (rr *RoundRobin) AddEndpoint(endpoint endpoint.Endpoint) error + func (rr *RoundRobin) ObserveRequest(request.Request) + func (rr *RoundRobin) ObserveResponse(req request.Request, a request.Attempt) + func (rr *RoundRobin) ProcessRequest(request.Request) (*http.Response, error) + func (rr *RoundRobin) ProcessResponse(req request.Request, a request.Attempt) + type SuggestedWeight interface + GetEndpoint func() *WeightedEndpoint + GetWeight func() int + SetWeight func(int) + type WeightedEndpoint struct + func (we *WeightedEndpoint) GetEffectiveWeight() int + func (we *WeightedEndpoint) GetId() string + func (we *WeightedEndpoint) GetMeter() metrics.FailRateMeter + func (we *WeightedEndpoint) GetOriginalEndpoint() endpoint.Endpoint + func (we *WeightedEndpoint) GetOriginalWeight() int + func (we *WeightedEndpoint) GetUrl() *url.URL + func (we *WeightedEndpoint) String() string + type WeightedEndpoints []*WeightedEndpoint + func (we WeightedEndpoints) Len() int + func (we WeightedEndpoints) Less(i, j int) bool + func (we WeightedEndpoints) Swap(i, j int)