Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HAProxyAllHostsTransitioning error = fmt.Errorf("Haproxy: all hosts are in transition. HAProxy is likely reloading")
View Source
var HAProxyAllUpHostsTransitioning error = fmt.Errorf("Haproxy: all host marked as UP are in transition. HAProxy is likely reloading")
View Source
var HAProxyEmptyBody error = fmt.Errorf("Haproxy GET error: empty body")
View Source
var HAProxyEmptyStatus error = fmt.Errorf("Haproxy CSV parsing error: no lines found")
View Source
var HAProxyMissingPool error = fmt.Errorf("Haproxy CSV parsing: pool not found")
View Source
var HAProxyPartialStatus error = fmt.Errorf("Haproxy CSV parsing error: only got partial file")
View Source
var MaxHTTPGetConcurrency = 2
Functions ¶
func FilterThrotllerHosts ¶
func FilterThrotllerHosts(backendHosts [](*BackendHost)) (hosts []string)
Types ¶
type BackendHost ¶
type BackendHost struct { Hostname string Status BackendHostStatus IsTransitioning bool }
func NewBackendHost ¶
func NewBackendHost(hostname string, status BackendHostStatus, isTransitioning bool) *BackendHost
func ParseCsvHosts ¶
func ParseCsvHosts(csv string, poolName string) (backendHosts [](*BackendHost), err error)
ParseCsvHosts reads HAProxy CSV text and returns lists of hosts participating in the given pool (backend). See comment for ParseHosts
func ParseHosts ¶
func ParseHosts(csvLines []string, poolName string) (backendHosts [](*BackendHost), err error)
ParseHosts reads HAProxy CSV lines and returns lists of hosts participating in the given pool (backend) Returned are all non-disabled hosts in given backend. Thus, a NOLB is skipped; any UP or DOWN hosts are returned. Such list indicates the hosts which can be expected to be active, which is then the list freno will probe.
type BackendHostStatus ¶
type BackendHostStatus string
const ( StatusDown BackendHostStatus = "DOWN" StatusNOLB BackendHostStatus = "NOLB" StatusUp BackendHostStatus = "UP" StatusNoCheck BackendHostStatus = "no check" StatusUnknown BackendHostStatus = "unkown" )
func ParseStatus ¶
func ParseStatus(fullStatus string) (status BackendHostStatus, isTransitioning bool)
func ToBackendHostStatus ¶
func ToBackendHostStatus(status string) BackendHostStatus
Click to show internal directories.
Click to hide internal directories.