Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { URL *url.URL Alive bool ReverseProxy *httputil.ReverseProxy // contains filtered or unexported fields }
Backend holds the data about a server
type ServerPool ¶
type ServerPool struct {
// contains filtered or unexported fields
}
ServerPool holds information about reachable backends
func (*ServerPool) AddBackend ¶
func (s *ServerPool) AddBackend(backend *Backend)
AddBackend to the server pool
func (*ServerPool) GetNextPeer ¶
func (s *ServerPool) GetNextPeer() *Backend
GetNextPeer returns next active peer to take a connection
func (*ServerPool) HealthCheck ¶
func (s *ServerPool) HealthCheck()
HealthCheck pings the backends and update the status
func (*ServerPool) MarkBackendStatus ¶
func (s *ServerPool) MarkBackendStatus(backendUrl *url.URL, alive bool)
MarkBackendStatus changes a status of a backend
func (*ServerPool) NextIndex ¶
func (s *ServerPool) NextIndex() int
NextIndex atomically increase the counter and return an index
Click to show internal directories.
Click to hide internal directories.