options

package
v6.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultUseValidation sane default using validation in client native
	DefaultUseValidation = true
	// DefaultPersistentTransactions sane default using persistent transactions in client native
	DefaultPersistentTransactions = true
	// DefaultValidateConfigurationFile is used to validate HAProxy configuration file
	DefaultValidateConfigurationFile = true

	// DefaultConfigurationFile sane default for path to haproxy configuration file
	DefaultConfigurationFile = "/etc/haproxy/haproxy.cfg"

	// DefaultHaproxy sane default for path to haproxy executable
	DefaultHaproxy = "/usr/sbin/haproxy"

	// DefaultTransactionDir sane default for path for transactions
	DefaultTransactionDir = "/etc/haproxy/transactions"

	// DefaultTimeSuffix uses the most appropriate Time unit for serialization
	DefaultTimeSuffix = "nearest"
)

Variables

View Source
var MasterWorker = masterWorker{} //nolint:gochecknoglobals
View Source
var SkipConfigurationFileValidation = skipConfigurationFileValidation{} //nolint:gochecknoglobals
View Source
var SkipFailedTransactions = skipFailedTransactions{} //nolint:gochecknoglobals
View Source
var UseMd5Hash = useMd5Hash{} //nolint:gochecknoglobals
View Source
var UseModelsValidation = useModelsValidation{} //nolint:gochecknoglobals
View Source
var UsePersistentTransactions = persistentTransactions{} //nolint:gochecknoglobals

Functions

This section is empty.

Types

type ConfigurationOption

type ConfigurationOption interface {
	Set(p *ConfigurationOptions) error
}

func Backups

func Backups(number int) ConfigurationOption

Backups sets number of backups for configuration file

func BackupsDir

func BackupsDir(bckDir string) ConfigurationOption

func ConfigurationFile

func ConfigurationFile(configurationFile string) ConfigurationOption

func HAProxyBin

func HAProxyBin(path string) ConfigurationOption

func PreferredTimeSuffix

func PreferredTimeSuffix(suffix string) ConfigurationOption

PreferredTimeSuffix allows specifying which time unit will be favored when serializing Time values in the configuration. Allowed values: nearest (default), none, ms, s, m, h, d.

func TransactionsDir

func TransactionsDir(path string) ConfigurationOption

func ValidateCmd

func ValidateCmd(cmd string) ConfigurationOption

ValidateCmd allows specifying a custom script to validate the transaction file. The injected environment variable DATAPLANEAPI_TRANSACTION_FILE must be used to get the location of the file.

func ValidateConfigFiles

func ValidateConfigFiles(before, after []string) ConfigurationOption

ValidateConfigFiles takes list of before an after configuration files that need to be checked along side ConfigurationFile this is sometimes necessary since HAProxy config can be in multiple files

type ConfigurationOptions

type ConfigurationOptions struct {
	ConfigurationFile string
	Haproxy           string
	TransactionDir    string
	BackupsDir        string

	// ValidateCmd allows specifying a custom script to validate the transaction file.
	// The injected environment variable DATAPLANEAPI_TRANSACTION_FILE must be used to get the location of the file.
	ValidateCmd                     string
	ValidateConfigFilesBefore       []string
	ValidateConfigFilesAfter        []string
	PreferredTimeSuffix             string
	BackupsNumber                   int
	PersistentTransactions          bool
	SkipFailedTransactions          bool
	UseModelsValidation             bool
	SkipConfigurationFileValidation bool // opposite of previously available ValidateConfigurationFile
	MasterWorker                    bool
	UseMd5Hash                      bool
}

Jump to

Keyboard shortcuts

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