Documentation ¶
Index ¶
- Variables
- type ApiBasicAuthConfig
- type ApiConfig
- type ApiTlsConfig
- type BackendsTls
- type Config
- type ConnectionOptions
- type ExecHealthcheckConfig
- type FilterRequestContent
- type HealthcheckConfig
- type LimitChinaAccess
- type LimitPeripRate
- type LimitReconnectRate
- type LoggingConfig
- type PingHealthcheckConfig
- type Server
- type Sni
- type Tls
- type Udp
- type Upstream
Constants ¶
This section is empty.
Variables ¶
View Source
var Configuration interface{}
View Source
var StartTime time.Time
View Source
var Version string
Functions ¶
This section is empty.
Types ¶
type ApiBasicAuthConfig ¶
type ApiBasicAuthConfig struct { Login string `toml:"login" json:"login"` Password string `toml:"password" json:"password"` }
*
- Api Basic Auth Config
type ApiConfig ¶
type ApiConfig struct { Enabled bool `toml:"enabled" json:"enabled"` Bind string `toml:"bind" json:"bind"` BasicAuth *ApiBasicAuthConfig `toml:"basic_auth" json:"basic_auth"` Tls *ApiTlsConfig `toml:"tls" json:"tls"` Cors bool `toml:"cors" json:"cors"` }
*
- Api config section
type ApiTlsConfig ¶
type ApiTlsConfig struct { CertPath string `toml:"cert_path" json:"cert_path"` KeyPath string `toml:"key_path" json:"key_path"` }
*
- Api TLS server Config
type BackendsTls ¶
type BackendsTls struct { IgnoreVerify bool `toml:"ignore_verify" json:"ignore_verify"` RootCaCertPath *string `toml:"root_ca_cert_path" json:"root_ca_cert_path"` CertPath *string `toml:"cert_path" json:"cert_path"` KeyPath *string `toml:"key_path" json:"key_path"` // contains filtered or unexported fields }
type Config ¶
type Config struct { Logging LoggingConfig `toml:"logging" json:"logging"` Api ApiConfig `toml:"api" json:"api"` Defaults ConnectionOptions `toml:"defaults" json:"defaults"` Servers map[string]Server `toml:"servers" json:"servers"` }
*
- Config file top-level object
type ConnectionOptions ¶
type ConnectionOptions struct { MaxConnections *int `toml:"max_connections" json:"max_connections"` ClientIdleTimeout *string `toml:"client_idle_timeout" json:"client_idle_timeout"` BackendIdleTimeout *string `toml:"backend_idle_timeout" json:"backend_idle_timeout"` BackendConnectionTimeout *string `toml:"backend_connection_timeout" json:"backend_connection_timeout"` ChinaIpdbPath string `toml:"china_ipdb_path" json:"china_ipdb_path"` }
*
- Default values can be overridden in server
type ExecHealthcheckConfig ¶
type ExecHealthcheckConfig struct { ExecCommand string `toml:"exec_command" json:"exec_command,omitempty"` ExecExpectedPositiveOutput string `toml:"exec_expected_positive_output" json:"exec_expected_positive_output"` ExecExpectedNegativeOutput string `toml:"exec_expected_negative_output" json:"exec_expected_negative_output"` }
type FilterRequestContent ¶
type FilterRequestContent struct { Mode string `toml:"mode" json:"mode"` Content string `toml:"content" json:"content"` Access string `toml:"access" json:"access"` }
*
- filter filter_request_content configuration
type HealthcheckConfig ¶
type HealthcheckConfig struct { Kind string `toml:"kind" json:"kind"` Interval string `toml:"interval" json:"interval"` Passes int `toml:"passes" json:"passes"` Fails int `toml:"fails" json:"fails"` Timeout string `toml:"timeout" json:"timeout"` *PingHealthcheckConfig *ExecHealthcheckConfig }
*
- Healthcheck configuration
type LimitChinaAccess ¶
type LimitChinaAccess struct { Area string `toml:"area" json:"area"` Region string `toml:"region" json:"region"` Isp string `toml:"isp" json:"isp"` Access string `toml:"access" json:"access"` }
*
- filter limit_china_access configuration
type LimitPeripRate ¶
type LimitPeripRate struct { Interval string `toml:"interval" json:"interval"` ReadBytes uint `toml:"readbytes" json:"readbytes"` WriteBytes uint `toml:"writebytes" json:"writebytes"` }
*
- filter limit_per_ip_rate configuration
type LimitReconnectRate ¶
type LimitReconnectRate struct { Interval string `toml:"interval" json:"interval"` Reconnects int `toml:"reconnects" json:"reconnects"` }
*
- filter limit_reconnect_rate configuration
type LoggingConfig ¶
type LoggingConfig struct { Level string `toml:"level" json:"level"` Output string `toml:"output" json:"output"` }
*
- Logging config section
type PingHealthcheckConfig ¶
type PingHealthcheckConfig struct{}
type Server ¶
type Server struct { ConnectionOptions // hostname:port Bind string `toml:"bind" json:"bind"` // tcp | udp | tls Protocol string `toml:"protocol" json:"protocol"` // weight | leastconn | roundrobin Balance string `toml:"balance" json:"balance"` //upstream Upstream []string `toml:"upstream" json:"upstream"` // Optional configuration for server name indication Sni *Sni `toml:"sni" json:"sni"` // Optional configuration for protocol = tls Tls *Tls `toml:"tls" json:"tls"` // Optional configuration for backend_tls_enabled = true BackendsTls *BackendsTls `toml:"backends_tls" json:"backends_tls"` // Optional configuration for protocol = udp Udp *Udp `toml:"udp" json:"udp"` // Filter limit_max_connection_filter configuration MaxConnections *int `toml:"max_connections" json:"max_connections"` // Filter limit_perip_connection_filter configuration PerIpConnections *uint `toml:"per_ip_connections" json:"per_ip_connections"` LimitReconnectRate *LimitReconnectRate `toml:"limit_reconnect_rate" json:"limit_reconnect_rate"` LimitPeripRate *LimitPeripRate `toml:"limit_per_ip_rate" json:"limit_per_ip_rate"` LimitChinaAccessDefault string `toml:"limit_china_access_default" json:"limit_china_access_default"` LimitChinaAccess []LimitChinaAccess `toml:"limit_china_access" json:"limit_china_access"` FilterRequestContentDefault string `toml:"filter_request_content_default" json:"filter_request_content_default"` FilterRequestContent []FilterRequestContent `toml:"filter_request_content" json:"filter_request_content"` // Healthcheck configuration Healthcheck *HealthcheckConfig `toml:"healthcheck" json:"healthcheck"` }
*
- Server section config
type Sni ¶
type Sni struct { HostnameMatchingStrategy string `toml:"hostname_matching_strategy" json:"hostname_matching_strategy"` UnexpectedHostnameStrategy string `toml:"unexpected_hostname_strategy" json:"unexpected_hostname_strategy"` ReadTimeout string `toml:"read_timeout" json:"read_timeout"` }
*
- Server Sni options
type Tls ¶
type Tls struct { CertPath string `toml:"cert_path" json:"cert_path"` KeyPath string `toml:"key_path" json:"key_path"` // contains filtered or unexported fields }
*
- Server Tls options
- for protocol = "tls"
Click to show internal directories.
Click to hide internal directories.