haproxy

package
v0.0.0-...-f2c13a2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSafeInt64

func GetSafeInt64(ptr *int64) int64

getSafeInt64 安全获取int64指针的值

func GetSafeString

func GetSafeString(ptr *string) string

getSafeString 安全获取字符串指针的值

func Int64P

func Int64P(v int64) *int64

Int64P 返回指向int64的指针

func StringP

func StringP(v string) *string

StringP 返回指向字符串的指针

Types

type HAProxyService

type HAProxyService interface {
	RemoveConfig() error
	HotReloadRemoveConfig() error
	CreateHAProxyCrtStore() error
	InitSpoeConfig() error
	InitHAProxyConfig() error
	AddCorazaBackend() error
	AddSiteConfig(site model.Site) error
	Start() error
	Reload() error
	Stop() error
	GetStatus() HAProxyStatus
	GetStats() (models.NativeStats, error)
	Reset() error
}

func NewHAProxyService

func NewHAProxyService(configBaseDir, haproxyBin string, ctx context.Context) (HAProxyService, error)

NewHAProxyService 创建一个新的HAProxy服务实例

type HAProxyServiceImpl

type HAProxyServiceImpl struct {
	ConfigBaseDir      string
	HAProxyConfigFile  string // 配置文件路径
	HaproxyBin         string // HAProxy二进制文件路径
	BackupsNumber      int
	CertDir            string // 证书目录
	TransactionDir     string // 事务目录
	SpoeDir            string // SPOE目录
	SpoeTransactionDir string // SPOE事务目录
	SocketFile         string // 套接字文件路径
	PidFile            string // PID文件路径
	SpoeConfigFile     string // SPOE配置文件路径
	SpoeAgentAddress   string // SPOE代理地址
	SpoeAgentPort      int64  // SPOE代理端口
	// contains filtered or unexported fields
}

func (*HAProxyServiceImpl) AddCorazaBackend

func (s *HAProxyServiceImpl) AddCorazaBackend() error

func (*HAProxyServiceImpl) AddSiteConfig

func (s *HAProxyServiceImpl) AddSiteConfig(site model.Site) error

func (*HAProxyServiceImpl) CreateHAProxyCrtStore

func (s *HAProxyServiceImpl) CreateHAProxyCrtStore() error

func (*HAProxyServiceImpl) GetStats

func (s *HAProxyServiceImpl) GetStats() (models.NativeStats, error)

func (*HAProxyServiceImpl) GetStatus

func (s *HAProxyServiceImpl) GetStatus() HAProxyStatus

func (*HAProxyServiceImpl) HotReloadRemoveConfig

func (s *HAProxyServiceImpl) HotReloadRemoveConfig() error

func (*HAProxyServiceImpl) InitHAProxyConfig

func (s *HAProxyServiceImpl) InitHAProxyConfig() error

InitHAProxyConfig 初始化HAProxy配置

func (*HAProxyServiceImpl) InitSpoeConfig

func (s *HAProxyServiceImpl) InitSpoeConfig() error

func (*HAProxyServiceImpl) Reload

func (s *HAProxyServiceImpl) Reload() error

func (*HAProxyServiceImpl) RemoveConfig

func (s *HAProxyServiceImpl) RemoveConfig() error

func (*HAProxyServiceImpl) Reset

func (s *HAProxyServiceImpl) Reset() error

func (*HAProxyServiceImpl) Start

func (s *HAProxyServiceImpl) Start() error

func (*HAProxyServiceImpl) Stop

func (s *HAProxyServiceImpl) Stop() error

type HAProxyStatus

type HAProxyStatus int32
const (
	StatusStopped HAProxyStatus = iota
	StatusRunning
	StatusError
)

Jump to

Keyboard shortcuts

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