mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-21 16:01:22 +02:00
cleanup some loadbalancer code
This commit is contained in:
@@ -9,9 +9,9 @@ type roundRobin struct {
|
||||
index atomic.Uint32
|
||||
}
|
||||
|
||||
func (*LoadBalancer) newRoundRobin() impl { return &roundRobin{} }
|
||||
func (lb *roundRobin) OnAddServer(srv *Server) {}
|
||||
func (lb *roundRobin) OnRemoveServer(srv *Server) {}
|
||||
func (*LoadBalancer) newRoundRobin() impl { return &roundRobin{} }
|
||||
func (lb *roundRobin) OnAddServer(srv Server) {}
|
||||
func (lb *roundRobin) OnRemoveServer(srv Server) {}
|
||||
|
||||
func (lb *roundRobin) ServeHTTP(srvs Servers, rw http.ResponseWriter, r *http.Request) {
|
||||
index := lb.index.Add(1) % uint32(len(srvs))
|
||||
|
||||
Reference in New Issue
Block a user