option

package
v1.20.11 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProxyHaproxy proxy haproxy
	ProxyHaproxy = "haproxy"
	// ProxyHaproxyDefaultBinPath haproxy proxy default bin path
	ProxyHaproxyDefaultBinPath = "/usr/sbin/haproxy"
	// ProxyHaproxyDefaultCfgPath haproxy proxy default config path
	ProxyHaproxyDefaultCfgPath = "/etc/haproxy/haproxy.cfg"
	// ProxyNginx proxy nginx
	ProxyNginx = "nginx"
	// ProxyNginxDefaultBinPath proxy nginx default bin path
	ProxyNginxDefaultBinPath = "/usr/local/nginx/sbin/nginx"
	// ProxyNginxDefaultCfgPath proxy nginx default config path
	ProxyNginxDefaultCfgPath = "/usr/local/nginx/conf/nginx.conf"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LBConfig

type LBConfig struct {
	conf.ClientOnlyCertConfig
	conf.LogConfig
	conf.FileConfig
	conf.ServiceConfig
	MetricPort int    `json:"metric_port" value:"59090" usage:"port for query metric info, version info and status info" mapstructure:"metric_port"`
	Zookeeper  string `json:"zk" value:"127.0.0.1:2381" usage:"zookeeper links for data source" mapstructure:"zk"`   //zk links
	WatchPath  string `json:"zkpath" value:"" usage:"service info path for watch, [required]" mapstructure:"zkpath"` //zk watch path
	// Name will be used in metric
	Name              string `json:"name" value:"" usage:"loadbalance instance name" mapstructure:"name"`
	Group             string `json:"group" value:"external" usage:"bcs loadbalance label for service join in" mapstructure:"group"` //group to serve
	Proxy             string `json:"proxy" value:"haproxy" usage:"proxy model, nginx or haproxy" mapstructure:"proxy"`              //proxy implenmentation, nginx or haproxy
	BcsZkAddr         string `json:"bcszkaddr" value:"127.0.0.1:2181" usage:"bcs zookeeper address" mapstructure:"bcszkaddr"`       //bcs zookeeper address
	ClusterZk         string `json:"clusterzk" value:"" usage:"cluster zookeeper address" mapstructure:"clusterzk"`
	ClusterID         string `json:"clusterid" value:"" usage:"loadbalance server mesos cluster id" mapstructure:"clusterid"`                     //cluster id to register path
	CfgBackupDir      string `json:"cfg_backup_dir" value:"" usage:"backup dir for loadbalance config file" mapstructure:"cfg_backup_dir"`        //haproxy cfg backup directory
	GeneratingDir     string `json:"generate_dir" value:"" usage:"dir for generated loadbalance config file" mapstructure:"generate_dir"`         //haproxy cfg generation directory
	TemplateDir       string `json:"template_dir" value:"" usage:"dir for template of loadbalance config file" mapstructure:"template_dir"`       //template file used to generate haproxy.cfg
	BinPath           string `json:"bin_path" value:"" usage:"bin path for proxy binary" mapstructure:"bin_path"`                                 //haproxy bin path
	CfgPath           string `json:"config_path" value:"" usage:"config path for proxy config" mapstructure:"config_path"`                        //haproxy configuration file path
	SyncPeriod        int    `json:"sync_period" value:"20" usage:"time period for syncing data" mapstructure:"sync_period"`                      //time period for syncing data
	CfgCheckPeriod    int    `json:"config_check_period" value:"5" usage:"time period for check cache update" mapstructure:"config_check_period"` //period check cache update
	StatusFetchPeriod int    `json:"stats_fetch_period" value:"5" usage:"time period for fetch proxy stats" mapstructure:"stats_fetch_period"`
}

LBConfig hold load balance all config

func NewConfig

func NewConfig() *LBConfig

NewConfig new a config

func (*LBConfig) Parse

func (c *LBConfig) Parse() error

Parse parse config

Jump to

Keyboard shortcuts

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