package
6.1.2
Repository: https://github.com/haproxytech/client-native.git
Documentation: pkg.go.dev

# README

HAProxy runtime client

usage

package main

import (
	"log"

	"github.com/haproxytech/client-native/v6/runtime"
	runtime_options "github.com/haproxytech/client-native/v6/runtime/options"
)

func main() {
	ms := runtime_options.MasterSocket("/var/run/haproxy-mw.sock")
	client, err = runtime_api.New(ctx, ms)
	if err != nil {
		return nil, fmt.Errorf("error setting up runtime client: %s", err.Error())
	}
	// or if not using master-worker
	socketList := map[int]string{
		1: "/var/run/haproxy-runtime-api.sock"
	}
	sockets := runtime_options.Sockets(socketList)
	client, err = runtime_api.New(ctx, mapsDir, sockets)
	if err != nil {
		return nil, fmt.Errorf("error setting up runtime client: %s", err.Error())
	}

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

# Packages

No description provided by the author

# Functions

CreateMap creates a new map file with its entries.
No description provided by the author
No description provided by the author
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.

# Structs

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.

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author