Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultMaxConnection = 512 DefaultMaxConnWaitTimeout = time.Second * 30 DefaultMaxConnDuration = time.Second * 10 DefaultMaxIdleConnDuration = time.Second * 10 DefaultMaxIdemponentCallAttempts = 5 DefaultHealtCheckerTime = time.Second * 30 Http1 = "http1.1" Http2 = "http2" DefaultMaxIdleWorkerDuration = 10 * time.Second )
Variables ¶
View Source
var ValidCustomHeaders = []string{"$remote_addr", "$time", "$uuid", "$incremental"}
View Source
var ValidTypes = []string{"round-robin", "w-round-robin", "ip-hash", "random", "least-connection"}
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { Url string `yaml:"url"` HealthCheckPath string `yaml:"health_check_path"` Weight uint `yaml:"weight,omitempty"` MaxConnection int `yaml:"max_conn"` MaxConnWaitTimeout time.Duration `yaml:"max_conn_timeout"` MaxConnDuration time.Duration `yaml:"max_conn_duration"` MaxIdleConnDuration time.Duration `yaml:"max_idle_conn_duration"` MaxIdemponentCallAttempts int `yaml:"max_idemponent_call_attempts"` }
func (*Backend) GetHealthCheckURL ¶
type Config ¶
type Config struct { CustomHeaders map[string]string `yaml:"custom_headers"` HealthCheckerFunc types.IsHostAlive HashFunc types.HashFunc Monitoring Monitoring `yaml:"monitoring"` Type string `yaml:"type"` Host string `yaml:"host"` Port string `yaml:"port"` Backends []Backend `yaml:"backends"` Server Server `yaml:"server"` HealthCheckerTime time.Duration `yaml:"health_checker_time"` }
func ParseConfigFile ¶
func (*Config) GetMonitoringAddr ¶
func (*Config) PrepareConfig ¶
type Monitoring ¶
type Server ¶ added in v0.3.0
type Server struct { HttpVersion string `yaml:"http_version"` CertFile string `yaml:"cert_file"` KeyFile string `yaml:"key_file"` MaxIdleWorkerDuration time.Duration `yaml:"max_idle_worker_duration"` TCPKeepalivePeriod time.Duration `yaml:"tcp_keepalive_period"` Concurrency int `yaml:"concurrency"` ReadTimeout time.Duration `yaml:"read_timeout"` WriteTimeout time.Duration `yaml:"write_timeout"` IdleTimeout time.Duration `yaml:"idle_timeout"` DisableKeepalive bool `yaml:"disable_keepalive"` DisableHeaderNamesNormalizing bool `yaml:"disable_header_names_normalizing"` }
Click to show internal directories.
Click to hide internal directories.