# README
HAProxy runtime client
usage
package main
import (
"log"
"github.com/haproxytech/client-native/v2/runtime"
)
func main() {
client := runtime.SingleRuntime{}
err := client.Init("/var/run/haproxy-runtime-api.sock", 1, 0)
if err != nil {
log.Println(err)
}
statsCollection := client.GetStats()
if statsCollection.Error != "" {
log.Println(err)
}
log.Println(statsCollection.Stats)
processInfo := client.GetInfo()
if processInfo.Error != "" {
log.Println(err)
}
log.Println(processInfo.Info)
env, err := client.ExecuteRaw("show env")
if err != nil {
log.Println(err)
}
log.Println(env)
}
# Functions
CreateMap creates a new map file with its entries.
DefaultClient return runtime Client with sane defaults.
NewHAProxyMock - create new haproxy mock.
ParseACLFileEntries parses array of entries in one Acl file One line sample entry: ID Value 0x560f3f9e8600 10.178.160.0.
ParseCrtListEntries parses array of entries in one CrtList file One line sample entry: /etc/ssl/cert-0.pem !*.crt-test.platform.domain.com !connectivitynotification.platform.domain.com !connectivitytunnel.platform.domain.com !authentication.cert.another.domain.com !*.authentication.cert.another.domain.com /etc/ssl/cert-1.pem [verify optional ca-file /etc/ssl/ca-file-1.pem] *.crt-test.platform.domain.com !connectivitynotification.platform.domain.com !connectivitytunnel.platform.domain.com !authentication.cert.another.domain.com !*.authentication.cert.another.domain.com /etc/ssl/cert-2.pem [verify required ca-file /etc/ssl/ca-file-2.pem].
ParseMapEntries parses array of entries in one map file One line sample entry: ID Key Value 0x55d155c6fbf0 static.example.com be_static.
ServerHealthValid checks if server health is valid.
ServerStateValid checks if server state is valid.
ServerWeightValid checks if server state is valid.
# Constants
DefaultSocketPath sane default for runtime API socket path.
# Structs
Client handles multiple HAProxy clients.
No description provided by the author
No description provided by the author
No description provided by the author
HAProxyMock - Mock HAProxy Server for testing the socket communication.
No description provided by the author
SingleRuntime handles one runtime API.
Task has command to execute on runtime api, and response channel for result.
TaskResponse ...