haproxy

package
v0.0.0-...-629a56e Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HAProxyClient

type HAProxyClient struct {
	// contains filtered or unexported fields
}

HAProxyClient provides a high-level interface for managing the HAProxy configuration.

func NewHAProxyClient

func NewHAProxyClient() *HAProxyClient

NewHAProxyClient creates a new instance of HAProxyClient.

func (*HAProxyClient) BindGoService

func (c *HAProxyClient) BindGoService(backendName string, targetService services.ServiceConfig) error

func (*HAProxyClient) BindService

func (c *HAProxyClient) BindService(backendName, serviceName, serviceAddress string, servicePort int) error

func (*HAProxyClient) DeleteAllServersFromBackend

func (c *HAProxyClient) DeleteAllServersFromBackend(backendName string) error

func (*HAProxyClient) DeleteServer

func (c *HAProxyClient) DeleteServer(backendName, serverName string) error

func (*HAProxyClient) ReplaceGoStub

func (c *HAProxyClient) ReplaceGoStub(backendName string, serviceProcess *services.ServiceProcess) error

type HAProxyConfigurationManager

type HAProxyConfigurationManager struct {
	// contains filtered or unexported fields
}

HAProxyConfigurationManager provides low-level functions for managing the HAProxy configuration.

func NewHAProxyConfigurationManager

func NewHAProxyConfigurationManager(apiURL, username, password string) *HAProxyConfigurationManager

NewHAProxyConfigurationManager creates a new instance of HAProxyConfigurationManager.

func (*HAProxyConfigurationManager) AddServer

func (c *HAProxyConfigurationManager) AddServer(backendName string, serverData map[string]interface{}, transactionID string) error

AddServer adds a new server to the specified backend in the HAProxy configuration.

func (*HAProxyConfigurationManager) CommitTransaction

func (c *HAProxyConfigurationManager) CommitTransaction(transactionID string) error

CommitTransaction commits the specified HAProxy configuration transaction.

func (*HAProxyConfigurationManager) CreateBackend

func (c *HAProxyConfigurationManager) CreateBackend(backendName, transactionID string) error

CreateBackend creates a new backend in the HAProxy configuration.

func (*HAProxyConfigurationManager) DeleteServer

func (c *HAProxyConfigurationManager) DeleteServer(backendName, serverName, transactionID string) error

func (*HAProxyConfigurationManager) GetCurrentConfigVersion

func (c *HAProxyConfigurationManager) GetCurrentConfigVersion() (int64, error)

GetCurrentConfigVersion retrieves the current HAProxy configuration version as an integer.

func (*HAProxyConfigurationManager) GetServersFromBackend

func (c *HAProxyConfigurationManager) GetServersFromBackend(backendName, transactionID string) ([]HAProxyServer, error)

func (*HAProxyConfigurationManager) RollbackTransaction

func (c *HAProxyConfigurationManager) RollbackTransaction(transactionID string) error

RollbackTransaction rolls back the specified HAProxy configuration transaction.

func (*HAProxyConfigurationManager) StartTransaction

func (c *HAProxyConfigurationManager) StartTransaction(version int64) (string, error)

type HAProxyServer

type HAProxyServer struct {
	Name    string `json:"name"`
	Address string `json:"address"`
	Port    int    `json:"port"`
}

type TransactionMiddleware

type TransactionMiddleware func(next func(transactionID string) error) func() error

TransactionMiddleware is a middleware that manages transactions for HAProxy operations.

func NewTransactionMiddleware

func NewTransactionMiddleware(configManager *HAProxyConfigurationManager) TransactionMiddleware

Jump to

Keyboard shortcuts

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