Documentation ¶
Index ¶
Constants ¶
View Source
const ( StatusOk = "OK" StatusDegraded = "DEGRADED" StatusCritical = "CRITICAL" StatusMaintenance = "MAINTENANCE" StatusUnknown = "UNKNOWN" )
View Source
const ( Tstartup = 60 // Startup time in seconds Kstartup = 4096 // Maximum slow start cost )
Variables ¶
This section is empty.
Functions ¶
func IsValidStatus ¶
func StatusWeight ¶
Types ¶
type ConnectionMetrics ¶
func NewConnectionMetrics ¶
func NewConnectionMetrics() ConnectionMetrics
func (*ConnectionMetrics) ConnectionDone ¶
func (c *ConnectionMetrics) ConnectionDone()
func (*ConnectionMetrics) ConnectionStart ¶
func (c *ConnectionMetrics) ConnectionStart()
func (*ConnectionMetrics) GetActiveConnections ¶
func (c *ConnectionMetrics) GetActiveConnections() uint32
func (*ConnectionMetrics) GetTotalConnections ¶
func (c *ConnectionMetrics) GetTotalConnections() uint64
type Pool ¶
type Pool struct { Name string Dummy bool Servers map[string]*Server Config PoolConfig Metrics ConnectionMetrics // contains filtered or unexported fields }
func NewPool ¶
func NewPool(name string, config PoolConfig) *Pool
func (*Pool) Handle ¶
func (p *Pool) Handle(logRecord *logger.HAProxyLogRecord)
func (*Pool) Reconfigure ¶
func (p *Pool) Reconfigure(config PoolConfig)
type PoolConfig ¶
type ResponseError ¶
type Server ¶
type Server struct { Address string Status ServerStatus Metrics ServerMetrics Transport *http.Transport }
func (*Server) CheckStatus ¶
type ServerMetrics ¶
func NewServerMetrics ¶
func NewServerMetrics() ServerMetrics
func (*ServerMetrics) Cost ¶
func (s *ServerMetrics) Cost() uint32
func (*ServerMetrics) RequestDone ¶
func (s *ServerMetrics) RequestDone()
func (*ServerMetrics) RequestStart ¶
func (s *ServerMetrics) RequestStart()
type ServerStatus ¶
func NewServerStatus ¶
func NewServerStatus() ServerStatus
func (*ServerStatus) Cost ¶
func (s *ServerStatus) Cost(accept string) uint32
func (*ServerStatus) ParseAndSet ¶
func (s *ServerStatus) ParseAndSet(res *http.Response) bool
func (*ServerStatus) Set ¶
func (s *ServerStatus) Set(status string) bool
Returns a bool representing if the status changed
func (*ServerStatus) SlowStartFactor ¶
func (s *ServerStatus) SlowStartFactor() uint32
Click to show internal directories.
Click to hide internal directories.