Documentation
¶
Index ¶
- func CreateIPRange(iprange string) ([]netip.Addr, error)
- type Filter
- type Pool
- type Server
- func (s *Server) Connect(proto, port string) (net.Conn, int64, error)
- func (s *Server) Disconnect(conn net.Conn) error
- func (s *Server) ExchangeData(client net.Conn, server net.Conn) (int64, int, int, error)
- func (s *Server) Fail()
- func (s *Server) SetConfig(weight, maxFails, breakTime string) error
- type ServerPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
the struct that contains array of filgerElements
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 Server ¶
type Server struct {
Addr netip.Addr
Broken bool
Weight int
Priority int
MaxFails int
AvgDataExchangeTime int64
AvgConnectTime int64
ConnectionsNumber int
CurrentConnectionsNumber int
// contains filtered or unexported fields
}
func (*Server) ExchangeData ¶
type ServerPool ¶
type ServerPool struct {
Servers []Server
}
the struct that keep servers addresses contain only IP addresses
func NewServerPool ¶
func NewServerPool(m map[string]interface{}) (*ServerPool, error)
create and return new ServerPool
func (*ServerPool) Add ¶
func (p *ServerPool) Add(addresses string, config map[string]interface{}) error
add IP address in servers pool
func (*ServerPool) AddFromMap ¶
func (p *ServerPool) AddFromMap(m map[string]interface{}) 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) SetConfig ¶
func (p *ServerPool) SetConfig(weight, maxFails, breakTime string) error
Click to show internal directories.
Click to hide internal directories.