Skip to content

bcicen/go-haproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc codebeat badge

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())

About

Go library for interacting with HAProxy via command socket

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages