func (s *ServerPool) NextIndex() int {
	return int(atomic.AddUint64(&s.current, uint64(1)) % uint64(len(s.backends)))
}
NextIndex atomically increase the counter and return an index
package proxy
import (
	"fmt"
	"net"
	"net/http/httputil"
	"net/url"
	"sync"
	"sync/atomic"
	"time"
	"github.com/kenriortega/ngonx/pkg/errors"
	"github.com/kenriortega/ngonx/pkg/logger"
)
type AttemptsOrRetry int
const (
	ATTEMPTS AttemptsOrRetry = iota
	RETRY
)
type Backend struct {
	URL          *url.URL
	Alive        bool
	mux          sync.RWMutex
	ReverseProxy *httputil.ReverseProxy
}
func (b *Backend) SetAlive(alive bool) {
	b.mux.Lock()
	b.Alive = alive
	b.mux.Unlock()
}
func (b *Backend) IsAlive() (alive bool) {
	b.mux.RLock()
	alive = b.Alive
	b.mux.RUnlock()
	return
}
type ServerPool struct {
	backends []*Backend
	current  uint64
}
func (s *ServerPool) AddBackend(backend *Backend) {
	s.backends = append(s.backends, backend)
}