Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bind ¶
type Bind struct { IP string Port int // TODO part away from balancer.Certs and create a struct that also holds the filename Certs []balancer.Certificate }
Bind ip port and certificates
type Defaults ¶
type Defaults struct { // running mode for HAProxy Mode string // default load balancing strategy Balance string // maximum number of connections for an upstream server Maxconn int // enables rich TCP log TCPLog bool // enables rich HTTP log HTTPLog bool // early drop of aborted requests AbortOnClose bool // enables connection close, allowing also keep-alive HTTPServerClose bool // adds X-Forwarded-For header ForwardFor bool // number of retries to servers Retries int // break affinity when the upstream server is down Redispatch bool // timeout for connections to an upstream server TimeoutConnect string // timeout for client inactivity TimeoutClient string // timeout for server inactivity TimeoutServer string // avoid logging empty data connections DontLogNull bool // timeout for health checks TimeoutCheck string // placeholder for other global parameters Others map[string]string }
Defaults HAProxy section
type FrontEnd ¶
type FrontEnd struct { Name string Bind Bind ACLs map[string]ACL DefaultBackend UseBackend UseBackends []UseBackend Opts []string }
FrontEnd listening and request parsing
func (FrontEnd) UseBackendsByPrio ¶
func (fe FrontEnd) UseBackendsByPrio() []UseBackend
UseBackendsByPrio returns ordered use_backend by priority
type Global ¶
type Global struct { // maximum concurrent connections Maxconn int // maximum number of pipes for kernel splicing Maxpipes int // Randomness for health checks intervals SpreadChecks int // Activate verbose logging Debug bool // placeholder for other global parameters Others map[string]string }
Global HAProxy section
type HAProxy ¶
type HAProxy struct { Global Global Defaults Defaults Frontends map[int]FrontEnd Backends map[string]Backend CertsDir string }
HAProxy balancer instance
func NewDefaultBalancer ¶
func NewDefaultBalancer() *HAProxy
NewDefaultBalancer returns an HAProxy balancer
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is an HAProxy manager
func (*Manager) ReloadBalancer ¶
ReloadBalancer starts the balancer process
func (*Manager) StartBalancer ¶
StartBalancer starts the balancer process
func (*Manager) StopBalancer ¶
StopBalancer stops balancer process
type Server ¶
Server for backend
func NewDefaultBackendServer ¶
func NewDefaultBackendServer() *Server
NewDefaultBackendServer returns a backend server
type UseBackend ¶
UseBackend associates backends and ACLs
type UseBackends ¶
type UseBackends []UseBackend
UseBackends holds a sortable collection of UseBackend
func (UseBackends) Less ¶
func (u UseBackends) Less(i, j int) bool
Less compares use_backend priotities
Click to show internal directories.
Click to hide internal directories.