modulepackage
0.0.0-20210728173702-412d077dabc1
Repository: https://github.com/bcicen/go-haproxy.git
Documentation: pkg.go.dev
# README
go-haproxy
Go library for interacting with HAProxys stats socket.
Usage
Initialize a client object. Supported address schemas are tcp://
and unix:///
client := &haproxy.HAProxyClient{
Addr: "tcp://localhost:9999",
}
Fetch results for a built in command(currently supports show stats
and show info
):
stats, err := client.Stats()
for _, i := range stats {
fmt.Printf("%s: %s\n", i.SvName, i.Status)
}
Or retrieve the result body from an arbitrary command string:
result, err := h.RunCommand("show info")
fmt.Println(result.String())
# Packages
No description provided by the author
# Structs
HAProxyClient is the main structure of the library.
Response from HAProxy "show info" command.
Response from HAProxy "show stat" command.