haproxy

package
v0.0.0-...-4c5efe1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Nobody = 65534

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LoadBalancers []*LoadBalancer
}

func NewConfig

func NewConfig(m map[string][]byte) (c Config, err error)

type HAProxyManager

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

func NewHAProxyManager

func NewHAProxyManager(configFile, service string) (ha *HAProxyManager, err error)

func (*HAProxyManager) IsRunning

func (ha *HAProxyManager) IsRunning(ctx context.Context) error

func (*HAProxyManager) Start

func (ha *HAProxyManager) Start(ctx context.Context) error

func (*HAProxyManager) Stop

func (ha *HAProxyManager) Stop(ctx context.Context) error

func (*HAProxyManager) UpdateConfig

func (ha *HAProxyManager) UpdateConfig(ctx context.Context, lbs Config) error

type LoadBalancer

type LoadBalancer struct {
	Name    string  `json:"name"`
	IP      string  `json:"ip"`
	CIDR    string  `json:"cidr"`
	Options Options `json:"options"`
	Ports   []Port  `json:"ports"`
}

type Options

type Options struct {
	Frontend           []string `json:"frontend"`
	Backend            []string `json:"backend"`
	ProxyProtocol      string   `json:"proxyProtocol"`
	CheckProxyProtocol bool     `json:"checkProxyProtocol"`
	DefaultServer      string   `json:"defaultServer"`
}

type Port

type Port struct {
	Port    int      `json:"port"`
	Servers []Server `json:"servers"`
}

type Server

type Server struct {
	Name string `json:"name"`
	IP   string `json:"ip"`
	Port int    `json:"port"`
}

type ServiceManager

type ServiceManager interface {
	Reload(context.Context) error
	Status(context.Context) error
	Start(context.Context) error
	Stop(context.Context) error
}

type SystemdManager

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

func NewSystemdManager

func NewSystemdManager(service string) *SystemdManager

func (*SystemdManager) Reload

func (sm *SystemdManager) Reload(ctx context.Context) error

func (*SystemdManager) Start

func (sm *SystemdManager) Start(ctx context.Context) error

func (*SystemdManager) Status

func (sm *SystemdManager) Status(ctx context.Context) error

func (*SystemdManager) Stop

func (sm *SystemdManager) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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