Versions in this module Expand all Collapse all v1 v1.3.3 Aug 20, 2021 v1.3.2 Aug 20, 2021 Changes in this version + const FSMGrowFactor + const FSMMaxWeight + func SetDefaultWeight(weight int) error + type CookieOptions struct + Domain string + Expires time.Time + HTTPOnly bool + MaxAge int + Path string + SameSite http.SameSite + Secure bool + type LBOption func(*RoundRobin) error + func EnableStickySession(stickySession *StickySession) LBOption + func ErrorHandler(h utils.ErrorHandler) LBOption + func RoundRobinLogger(l *log.Logger) LBOption + func RoundRobinRequestRewriteListener(rrl RequestRewriteListener) LBOption + type Meter interface + IsReady func() bool + Rating func() float64 + Record func(int, time.Duration) + type NewMeterFn func() (Meter, error) + type Rebalancer struct + func NewRebalancer(handler balancerHandler, opts ...RebalancerOption) (*Rebalancer, error) + func (rb *Rebalancer) RemoveServer(u *url.URL) error + func (rb *Rebalancer) ServeHTTP(w http.ResponseWriter, req *http.Request) + func (rb *Rebalancer) Servers() []*url.URL + func (rb *Rebalancer) UpsertServer(u *url.URL, options ...ServerOption) error + func (rb *Rebalancer) Wrap(next balancerHandler) error + type RebalancerOption func(*Rebalancer) error + func RebalancerBackoff(d time.Duration) RebalancerOption + func RebalancerClock(clock timetools.TimeProvider) RebalancerOption + func RebalancerErrorHandler(h utils.ErrorHandler) RebalancerOption + func RebalancerLogger(l *log.Logger) RebalancerOption + func RebalancerMeter(newMeter NewMeterFn) RebalancerOption + func RebalancerRequestRewriteListener(rrl RequestRewriteListener) RebalancerOption + func RebalancerStickySession(stickySession *StickySession) RebalancerOption + type RequestRewriteListener func(oldReq *http.Request, newReq *http.Request) + type RoundRobin struct + func New(next http.Handler, opts ...LBOption) (*RoundRobin, error) + func (r *RoundRobin) Next() http.Handler + func (r *RoundRobin) NextServer(addr string) (*url.URL, error) + func (r *RoundRobin) RemoveServer(u *url.URL) error + func (r *RoundRobin) ServeHTTP(w http.ResponseWriter, req *http.Request) + func (r *RoundRobin) ServerWeight(u *url.URL) (int, bool) + func (r *RoundRobin) Servers() []*url.URL + func (r *RoundRobin) UpsertServer(u *url.URL, options ...ServerOption) error + type ServerOption func(*server) error + func Weight(w int) ServerOption + type StickySession struct + func NewStickySession(cookieName string) *StickySession + func NewStickySessionWithOptions(cookieName string, options CookieOptions) *StickySession + func (s *StickySession) GetBackend(req *http.Request, servers []*url.URL) (*url.URL, bool, error) + func (s *StickySession) SetCookieValue(value stickycookie.CookieValue) *StickySession + func (s *StickySession) StickBackend(backend *url.URL, w *http.ResponseWriter)