Documentation
¶
Index ¶
- Constants
- type Backend
- type LoadBalancer
- type Server
- type SimpleLoadBalancer
- func (lb *SimpleLoadBalancer) AddBackend(server *Server)
- func (lb *SimpleLoadBalancer) CheckAllBackendsHealth()
- func (lb *SimpleLoadBalancer) GetAllServers() []*Server
- func (lb *SimpleLoadBalancer) GetBackend() (*Server, error)
- func (lb *SimpleLoadBalancer) Initialize()
- func (lb *SimpleLoadBalancer) ReleaseBackend(server *Server)
- func (lb *SimpleLoadBalancer) RemoveBackend(serverURL *url.URL)
- func (lb *SimpleLoadBalancer) StartHealthChecks()
Constants ¶
View Source
const HealthCheckInterval = 10 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
func (*Backend) CheckHealth ¶
func (b *Backend) CheckHealth()
type LoadBalancer ¶
type Server ¶
func (*Server) CheckHealth ¶
func (s *Server) CheckHealth()
type SimpleLoadBalancer ¶
type SimpleLoadBalancer struct { Servers []*Server // contains filtered or unexported fields }
func (*SimpleLoadBalancer) AddBackend ¶
func (lb *SimpleLoadBalancer) AddBackend(server *Server)
func (*SimpleLoadBalancer) CheckAllBackendsHealth ¶
func (lb *SimpleLoadBalancer) CheckAllBackendsHealth()
func (*SimpleLoadBalancer) GetAllServers ¶
func (lb *SimpleLoadBalancer) GetAllServers() []*Server
Em loadbalancer.go
func (*SimpleLoadBalancer) GetBackend ¶
func (lb *SimpleLoadBalancer) GetBackend() (*Server, error)
func (*SimpleLoadBalancer) Initialize ¶
func (lb *SimpleLoadBalancer) Initialize()
func (*SimpleLoadBalancer) ReleaseBackend ¶
func (lb *SimpleLoadBalancer) ReleaseBackend(server *Server)
func (*SimpleLoadBalancer) RemoveBackend ¶
func (lb *SimpleLoadBalancer) RemoveBackend(serverURL *url.URL)
func (*SimpleLoadBalancer) StartHealthChecks ¶
func (lb *SimpleLoadBalancer) StartHealthChecks()
Click to show internal directories.
Click to hide internal directories.