config

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: Apache-2.0 Imports: 2 Imported by: 38

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetBeaconConfigDefaults added in v1.3.0

func SetBeaconConfigDefaults(c *ExtensionConfig)

func SetConfigDefaults

func SetConfigDefaults(c *ExtensionConfig) error

SetConfigDefaults sets default values if not present ExtensionConfig.Name must be set before calling this function

func SetHAProxyConfigDefaults added in v1.1.1

func SetHAProxyConfigDefaults(c *ExtensionConfig)

func SetNginxConfigDefaults added in v1.1.1

func SetNginxConfigDefaults(c *ExtensionConfig)

Types

type Config

type Config struct {
	ListenAddr    string
	DockerURL     string
	TLSCACert     string
	TLSCert       string
	TLSKey        string
	AllowInsecure bool
	EnableMetrics bool
	PollInterval  string
	Extensions    []*ExtensionConfig
	Rules         map[string]*Rule // beacon TODO: move to ExtensionConfig
}

Config is the top level configuration

func ParseConfig

func ParseConfig(data string) (*Config, error)

ParseConfig returns a Config object from a raw string config TOML

type ExtensionConfig

type ExtensionConfig struct {
	Name                          string           // extension name
	ConfigPath                    string           // config file path
	ConfigBasePath                string           `toml:"-"` // internal
	PidPath                       string           // haproxy, nginx
	TemplatePath                  string           // template file path
	BackendOverrideAddress        string           // haproxy, nginx
	ConnectTimeout                int              // haproxy
	ServerTimeout                 int              // haproxy
	ClientTimeout                 int              // haproxy
	MaxConn                       int              // haproxy, nginx
	Port                          int              // haproxy, nginx
	SyslogAddr                    string           // haproxy
	AdminUser                     string           // haproxy
	AdminPass                     string           // haproxy
	SSLCertPath                   string           // haproxy, nginx
	SSLCert                       string           // haproxy
	SSLPort                       int              // haproxy, nginx
	SSLOpts                       string           // haproxy
	SSLDefaultDHParam             int              // haproxy
	SSLServerVerify               string           // haproxy
	DHParam                       bool             // nginx
	DHParamPath                   string           // nginx
	NginxPlusEnabled              bool             // nginx
	User                          string           // nginx
	WorkerProcesses               int              // nginx
	RLimitNoFile                  int              // nginx
	ProxyConnectTimeout           int              // nginx
	ProxySendTimeout              int              // nginx
	ProxyReadTimeout              int              // nginx
	SendTimeout                   int              // nginx
	SSLCiphers                    string           // nginx
	SSLProtocols                  string           // nginx
	StatsInterval                 string           // beacon
	StatsBackendType              string           // beacon (influxdb, prometheus)
	StatsPrometheusPushGatewayURL string           // beacon (prometheus)
	StatsInfluxDBAddress          string           // beacon (influxdb)
	StatsInfluxDBUser             string           // beacon (influxdb user)
	StatsInfluxDBPassword         string           // beacon (influxdb password)
	StatsInfluxDBDatabase         string           // beacon (influxdb)
	StatsInfluxDBPrecision        string           // beacon (influxdb)
	Rules                         map[string]*Rule // beacon FIXME: this isn't loaded properly from toml; we set it as a hack now
}

ExtensionConfig has all options for all load balancer extensions the extension itself will use whichever options needed

type Rule added in v1.1.0

type Rule struct {
	Type  string
	Regex string
}

TODO: Rules allow for filtering metrics Note: for use with the Beacon extension only

Jump to

Keyboard shortcuts

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