socket

package
v0.14.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HAProxySocket

type HAProxySocket interface {
	Address() string
	HasConn() bool
	Send(observer func(duration time.Duration), command ...string) ([]string, error)
	Unlistening() error
	Close() error
}

HAProxySocket ...

func NewSocket

func NewSocket(address string, keepalive bool) HAProxySocket

NewSocket ...

func NewSocketConcurrent

func NewSocketConcurrent(address string, keepalive bool) HAProxySocket

NewSocketConcurrent ...

type Proc

type Proc struct {
	Type    string
	PID     int
	RPID    int
	Reloads int
	Failed  int
	Uptime  string
	Version string
}

Proc ...

type ProcTable

type ProcTable struct {
	Master     Proc
	Workers    []Proc
	OldWorkers []Proc
}

ProcTable ...

func HAProxyProcs

func HAProxyProcs(masterSocket HAProxySocket) (*ProcTable, error)

HAProxyProcs reads and converts `show proc` from the master CLI to a ProcTable instance. Waits for the reload to complete while master CLI is down and the attempt to connect leads to a connection refused. Some context: https://www.mail-archive.com/haproxy@formilux.org/msg38415.html The amount of time between attempts increases exponentially between 1ms and 64ms, and arithmetically between 128ms and 1s in order to save CPU on long reload events and quit fast on the fastest ones. The whole processing time can be calculated by the caller as the haproxy reload time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL