Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BalancingMethod ¶
type BalancingMethod interface {
Find(ip string, p *ServerPool) (string, error)
}
Find - return the server that should handle request
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
the struct that keep clients addresses caontain IP addresses "192.168.0.1" and IP networks "192.168.0.0/24"
type ServerPool ¶
the struct that keep servers addresses contain only IP addresses
func NewServerPool ¶
func NewServerPool(ip ...string) (*ServerPool, error)
create and return new ServerPool
func (*ServerPool) AddArr ¶
func (p *ServerPool) AddArr(arr []string) error
add IP address in servers pool from array
func (*ServerPool) Contains ¶
func (p *ServerPool) Contains(searchIP string) (bool, error)
check the server IP in pool or not return true if pool contain IP
func (*ServerPool) WhatServer ¶
func (p *ServerPool) WhatServer(ip string, bm BalancingMethod) (string, error)
check that server should handle request
Click to show internal directories.
Click to hide internal directories.