Documentation ¶
Index ¶
- func BuildRawFrontends(hosts []*Host) (frontends []*Frontend, sslpassthrough []*Host, defaultBind *BindConfig)
- type AgentCheck
- type Backend
- func (b *Backend) AcquireEndpoint(ip string, port int, targetRef string) *Endpoint
- func (b *Backend) AddEmptyEndpoint() *Endpoint
- func (b *Backend) AddHostPath(hostname, path string) *BackendPath
- func (b *Backend) CreateConfigBool(value bool) []*BackendConfigBool
- func (b *Backend) FindEndpoint(target string) *Endpoint
- func (b *Backend) FindHostPath(hostpath string) *BackendPath
- func (b *Backend) HasCorsEnabled() bool
- func (b *Backend) HasModsec() bool
- func (b *Backend) HasSSLRedirect() bool
- func (b *Backend) HasSSLRedirectHostpath(hostpath string) bool
- func (b *Backend) HasSSLRedirectPaths(paths *BackendPaths) bool
- func (b *Backend) Hostnames() []string
- func (b *Backend) MaxBodySizeHostpath(hostpath string) int64
- func (b *Backend) NeedACL() bool
- func (b *Backend) SortEndpoints()
- type BackendConfigAuth
- type BackendConfigBool
- type BackendConfigCors
- type BackendConfigHSTS
- type BackendConfigInt
- type BackendConfigStr
- type BackendConfigWhitelist
- type BackendLimit
- type BackendPath
- type BackendPaths
- type BackendTLSConfig
- type BackendTimeoutConfig
- type BindConfig
- type BindTLSConfig
- type BindUtils
- type Cookie
- type CookieConfig
- type Cors
- type DHParamConfig
- type DNSConfig
- type DNSNameserver
- type DNSResolver
- type DrainConfig
- type DynBackendConfig
- type Endpoint
- type EndpointNaming
- type Frontend
- type FrontendGroup
- type Global
- type GlobalBindConfig
- type HSTS
- type HealthCheck
- type HealthzConfig
- type Host
- type HostAliasConfig
- type HostBackend
- type HostPath
- type HostTLSConfig
- type HostTimeoutConfig
- type HostsMap
- type HostsMapEntry
- type HostsMaps
- type ModSecurityConfig
- type ModSecurityTimeoutConfig
- type OAuthConfig
- type ProcsConfig
- type SSLConfig
- type ServerConfig
- type StatsConfig
- type SyslogConfig
- type TCPBackend
- type TCPEndpoint
- type TCPProxyProt
- type TCPSSL
- type TimeoutConfig
- type User
- type Userlist
- type UserlistConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRawFrontends ¶
func BuildRawFrontends(hosts []*Host) (frontends []*Frontend, sslpassthrough []*Host, defaultBind *BindConfig)
BuildRawFrontends ...
Types ¶
type AgentCheck ¶
AgentCheck ...
type Backend ¶
type Backend struct { // // core config // ID string Namespace string Name string Port string Endpoints []*Endpoint EpNaming EndpointNaming Paths []*BackendPath PathsMap *HostsMap // // per backend config // AgentCheck AgentCheck BalanceAlgorithm string Cookie Cookie CustomConfig []string Dynamic DynBackendConfig HealthCheck HealthCheck Limit BackendLimit ModeTCP bool OAuth OAuthConfig Resolver string Server ServerConfig Timeout BackendTimeoutConfig TLS BackendTLSConfig WhitelistTCP []string // // per path config // // TODO refactor // // The current implementation is tricky. A small refactor is welcome // but can wait a little more. Multipath unit tests need to do a // better job as well. // // Following some tips in order to multipath work properly: // // 1. On backend annotation parsing, do not filter // mapper.GetBackendConfig/Str() slice, instead populate // haproxy type even with empty data. Backend.NeedACL() need // to know all paths in order to work properly. Filter out // empty/disabled items in the template. // // 2. Every config array added here, need also to be added // in Backend.NeedACL() - haproxy/types/backend.go. // Template uses this func in order to know if a config // has two or more paths, and so need to be configured with ACL. // AuthHTTP []*BackendConfigAuth Cors []*BackendConfigCors HSTS []*BackendConfigHSTS MaxBodySize []*BackendConfigInt RewriteURL []*BackendConfigStr SSLRedirect []*BackendConfigBool WAF []*BackendConfigStr WhitelistHTTP []*BackendConfigWhitelist }
Backend ...
func (*Backend) AcquireEndpoint ¶
AcquireEndpoint ...
func (*Backend) AddEmptyEndpoint ¶
AddEmptyEndpoint ...
func (*Backend) AddHostPath ¶
func (b *Backend) AddHostPath(hostname, path string) *BackendPath
AddHostPath ...
func (*Backend) CreateConfigBool ¶
func (b *Backend) CreateConfigBool(value bool) []*BackendConfigBool
CreateConfigBool ...
func (*Backend) FindEndpoint ¶
FindEndpoint ...
func (*Backend) FindHostPath ¶
func (b *Backend) FindHostPath(hostpath string) *BackendPath
FindHostPath ...
func (*Backend) HasSSLRedirectHostpath ¶
HasSSLRedirectHostpath ...
func (*Backend) HasSSLRedirectPaths ¶
func (b *Backend) HasSSLRedirectPaths(paths *BackendPaths) bool
HasSSLRedirectPaths ...
func (*Backend) MaxBodySizeHostpath ¶
MaxBodySizeHostpath ...
type BackendConfigAuth ¶
type BackendConfigAuth struct { Paths BackendPaths UserlistName string Realm string }
BackendConfigAuth ...
type BackendConfigBool ¶
type BackendConfigBool struct { Paths BackendPaths Config bool }
BackendConfigBool ...
type BackendConfigCors ¶
type BackendConfigCors struct { Paths BackendPaths Config Cors }
BackendConfigCors ...
type BackendConfigHSTS ¶
type BackendConfigHSTS struct { Paths BackendPaths Config HSTS }
BackendConfigHSTS ...
type BackendConfigInt ¶
type BackendConfigInt struct { Paths BackendPaths Config int64 }
BackendConfigInt ...
type BackendConfigStr ¶
type BackendConfigStr struct { Paths BackendPaths Config string }
BackendConfigStr ...
type BackendConfigWhitelist ¶
type BackendConfigWhitelist struct { Paths BackendPaths Config []string }
BackendConfigWhitelist ...
type BackendLimit ¶
BackendLimit ...
type BackendPath ¶
BackendPath ...
type BackendTLSConfig ¶
BackendTLSConfig ...
type BackendTimeoutConfig ¶
type BackendTimeoutConfig struct { Connect string HTTPRequest string KeepAlive string Queue string Server string ServerFin string Tunnel string }
BackendTimeoutConfig ...
type BindConfig ¶
type BindConfig struct { Name string Socket string ID int Hosts []*Host // AcceptProxy bool TLS BindTLSConfig // Maps *HostsMaps UseServerList *HostsMap }
BindConfig ...
func NewFrontendBind ¶
func NewFrontendBind(host *Host) *BindConfig
NewFrontendBind and BindConfig.Match should always sinchronize its attributes
type BindTLSConfig ¶
type BindTLSConfig struct { ALPN string CAFilename string CAHash string TLSCert string TLSCertDir string }
BindTLSConfig ...
type Cors ¶
type Cors struct { Enabled bool // AllowCredentials bool AllowHeaders string AllowMethods string AllowOrigin string ExposeHeaders string MaxAge int }
Cors ...
type DHParamConfig ¶
DHParamConfig ...
type DNSConfig ¶
type DNSConfig struct { ClusterDomain string Resolvers []*DNSResolver }
DNSConfig ...
type DNSNameserver ¶
DNSNameserver ...
func (*DNSNameserver) String ¶
func (dns *DNSNameserver) String() string
type DNSResolver ¶
type DNSResolver struct { Name string Nameservers []*DNSNameserver AcceptedPayloadSize int HoldObsolete string HoldValid string TimeoutRetry string }
DNSResolver ...
func (*DNSResolver) String ¶
func (dns *DNSResolver) String() string
type DynBackendConfig ¶
DynBackendConfig ...
type Endpoint ¶
type Endpoint struct { Enabled bool IP string Name string Port int Target string TargetRef string Weight int }
Endpoint ...
type EndpointNaming ¶
type EndpointNaming int
EndpointNaming ...
const ( EpSequence EndpointNaming = iota EpIPPort EpTargetRef )
...
type Frontend ¶
type Frontend struct { Name string Binds []*BindConfig Hosts []*Host // Timeout HostTimeoutConfig // Maps *HostsMaps HostBackendsMap *HostsMap MaxBodySizeMap *HostsMap RootRedirMap *HostsMap SNIBackendsMap *HostsMap TLSInvalidCrtErrorList *HostsMap TLSInvalidCrtErrorPagesMap *HostsMap TLSNoCrtErrorList *HostsMap TLSNoCrtErrorPagesMap *HostsMap }
Frontend ...
func NewFrontend ¶
NewFrontend and Frontend.Match should always sinchronize its attributes
func (*Frontend) HasInvalidErrorPage ¶
HasInvalidErrorPage ...
func (*Frontend) HasNoCrtErrorPage ¶
HasNoCrtErrorPage ...
type FrontendGroup ¶
type FrontendGroup struct { Frontends []*Frontend // DefaultBind *BindConfig HasSSLPassthrough bool ToHTTPBind BindConfig // Maps *HostsMaps HTTPFrontsMap *HostsMap HTTPRootRedirMap *HostsMap HTTPSRedirMap *HostsMap SSLPassthroughMap *HostsMap VarNamespaceMap *HostsMap }
FrontendGroup ...
func (*FrontendGroup) HasVarNamespace ¶
func (fg *FrontendGroup) HasVarNamespace() bool
HasVarNamespace ...
type Global ¶
type Global struct { Bind GlobalBindConfig Procs ProcsConfig Syslog SyslogConfig MaxConn int Timeout TimeoutConfig SSL SSLConfig DNS DNSConfig ModSecurity ModSecurityConfig Cookie CookieConfig DrainSupport DrainConfig ForwardFor string LoadServerState bool AdminSocket string Healthz HealthzConfig Stats StatsConfig StrictHost bool CustomConfig []string CustomDefaults []string CustomFrontend []string }
Global ...
type GlobalBindConfig ¶
type GlobalBindConfig struct { AcceptProxy bool HTTPBind string HTTPSBind string TCPBindIP string FrontingBind string FrontingSockID int }
GlobalBindConfig ...
func (GlobalBindConfig) HasFrontingProxy ¶
func (b GlobalBindConfig) HasFrontingProxy() bool
HasFrontingProxy ...
func (GlobalBindConfig) ShareHTTPPort ¶
func (b GlobalBindConfig) ShareHTTPPort() bool
ShareHTTPPort ...
type HealthCheck ¶
type HealthCheck struct { Addr string FallCount int Interval string Port int RiseCount int URI string }
HealthCheck ...
type Host ¶
type Host struct { Hostname string Paths []*HostPath // Alias HostAliasConfig HTTPPassthroughBackend string RootRedirect string SSLPassthrough bool Timeout HostTimeoutConfig TLS HostTLSConfig VarNamespace bool }
Host ...
Wildcard `*` hostname is a catch all and will be used if no other hostname, alias or regex matches the request. If wildcard hostname is not declared, the default backend will be used. If the default backend is empty, a default 404 page generated by HAProxy will be used.
type HostAliasConfig ¶
HostAliasConfig ...
type HostBackend ¶
HostBackend ...
type HostPath ¶
type HostPath struct { Path string Backend HostBackend }
HostPath ...
Root context `/` path is a catch all and will be used if no other path matches the request on this host. If a root context path is not declared, the default backend will be used. If the default backend is empty, a default 404 page generated by HAProxy will be used.
type HostTLSConfig ¶
type HostTLSConfig struct { CAErrorPage string CAFilename string CAHash string CAVerifyOptional bool TLSFilename string TLSHash string }
HostTLSConfig ...
type HostTimeoutConfig ¶
HostTimeoutConfig ...
type HostsMap ¶
type HostsMap struct { Match []*HostsMapEntry MatchFile string Regex []*HostsMapEntry RegexFile string }
HostsMap ...
func (*HostsMap) AppendAliasName ¶
AppendAliasName ...
func (*HostsMap) AppendAliasRegex ¶
AppendAliasRegex ...
func (*HostsMap) AppendHostname ¶
AppendHostname ...
type ModSecurityConfig ¶
type ModSecurityConfig struct { Endpoints []string Timeout ModSecurityTimeoutConfig }
ModSecurityConfig ...
type ModSecurityTimeoutConfig ¶
ModSecurityTimeoutConfig ...
type OAuthConfig ¶
type OAuthConfig struct { Impl string BackendName string URIPrefix string Headers map[string]string }
OAuthConfig ...
type ProcsConfig ¶
type ProcsConfig struct { Nbproc int Nbthread int NbprocBalance int NbprocSSL int BindprocBalance string BindprocSSL string CPUMap string }
ProcsConfig ...
type SSLConfig ¶
type SSLConfig struct { ALPN string DHParam DHParamConfig Ciphers string Options string Engine string ModeAsync bool HeadersPrefix string }
SSLConfig ...
type ServerConfig ¶
type ServerConfig struct { CAFilename string CAHash string Ciphers string // TLS up to 1.2 CipherSuites string // TLS 1.3 CRLFilename string CRLHash string CrtFilename string CrtHash string InitialWeight int MaxConn int MaxQueue int Options string Protocol string Secure bool SendProxy string }
ServerConfig ...
type StatsConfig ¶
type StatsConfig struct { AcceptProxy bool Auth string BindIP string Port int TLSFilename string TLSHash string }
StatsConfig ...
type SyslogConfig ¶
type SyslogConfig struct { Endpoint string Format string HTTPLogFormat string HTTPSLogFormat string Tag string TCPLogFormat string }
SyslogConfig ...
type TCPBackend ¶
type TCPBackend struct { Name string Port int Endpoints []*TCPEndpoint CheckInterval string SSL TCPSSL ProxyProt TCPProxyProt }
TCPBackend ...
func (*TCPBackend) AddEndpoint ¶
func (b *TCPBackend) AddEndpoint(ip string, port int) *TCPEndpoint
AddEndpoint ...
type TCPEndpoint ¶
TCPEndpoint ...
type TimeoutConfig ¶
type TimeoutConfig struct { HostTimeoutConfig BackendTimeoutConfig Stop string }
TimeoutConfig ...