utils

package
v2.3.11+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const (
	FileModeDir           = os.FileMode(0755)
	FileModeFile          = os.FileMode(0644)
	FileModeDirSensitive  = os.FileMode(0700)
	FileModeFileSensitive = os.FileMode(0600)
)
View Source
const (
	ConfigDirMode = os.FileMode(0755)
)
View Source
const HaproxyCfgExt = "cfg"

Variables

This section is empty.

Functions

func DirStagingToFinal

func DirStagingToFinal(s string) string

func HaproxyBalanceAlgorithm

func HaproxyBalanceAlgorithm(scheduler string) (balance string, err error)

func HaproxyConfigHttpCheck

func HaproxyConfigHttpCheck(uri, domain string) string

func HaproxyConfigHttpCheckExpect

func HaproxyConfigHttpCheckExpect(s string) string

func KeepalivedConfHexQuote

func KeepalivedConfHexQuote(s string) string

func KeepalivedConfQuoteScriptArgs

func KeepalivedConfQuoteScriptArgs(args []string) string

func ReadPidFile

func ReadPidFile(pidFile string) *os.Process

func WritePidFile

func WritePidFile(pid int, pidFile string) error

Types

type ConfigDirManager

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

func NewConfigDirManager

func NewConfigDirManager(baseDir string) *ConfigDirManager

TODO

  • set active

func (*ConfigDirManager) MostRecentSubdir

func (m *ConfigDirManager) MostRecentSubdir() string

func (*ConfigDirManager) NewDir

func (m *ConfigDirManager) NewDir(f DirFunc) (finalDir string, err error)

call f() inside 20180830.104050.333.lbcorpus.json.staging move to final name 20180830.104050.333.lbcorpus.json

func (*ConfigDirManager) Prune

func (m *ConfigDirManager) Prune(nRetain int) error

type DirFunc

type DirFunc func(string) error

type HaproxySslPolicyParams

type HaproxySslPolicyParams struct {
	SslMinVer string
	Ciphers   string
}

func HaproxySslPolicy

func HaproxySslPolicy(policy string) *HaproxySslPolicyParams

TODO restrict ciphers as noted in https://help.aliyun.com/document_detail/90740.html

Jump to

Keyboard shortcuts

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