Documentation ¶
Index ¶
- func BuildRawFrontends(hosts []*Host) (frontends []*Frontend, sslpassthrough []*Host, defaultBind *BindConfig)
- type Acme
- type AcmeData
- 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 BackendConfigWAF
- type BackendConfigWhitelist
- type BackendLimit
- type BackendPath
- type BackendPaths
- type BackendTLSConfig
- type BackendTimeoutConfig
- type BindConfig
- type BindTLSConfig
- type BlueGreenConfig
- 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
- func (hm *HostsMap) AppendAliasName(base, value string)
- func (hm *HostsMap) AppendAliasRegex(base, value string)
- func (hm *HostsMap) AppendHostname(base, value string)
- func (hm *HostsMap) AppendItem(item string)
- func (hm *HostsMap) AppendPath(hostpath, id string)
- func (hm *HostsMap) HasHost() bool
- func (hm *HostsMap) HasRegex() bool
- type HostsMapEntry
- type HostsMaps
- type ModSecurityConfig
- type ModSecurityTimeoutConfig
- type OAuthConfig
- type ProcsConfig
- type PromConfig
- type SSLConfig
- type ServerConfig
- type StatsConfig
- type SyslogConfig
- type TCPBackend
- type TCPEndpoint
- type TCPProxyProt
- type TCPSSL
- type TimeoutConfig
- type User
- type Userlist
- type UserlistConfig
- type WAF
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 AcmeData ¶ added in v0.9.1
type AcmeData struct { Certs map[string]map[string]struct{} Emails string Endpoint string Expiring time.Duration TermsAgreed bool }
AcmeData ...
func (*AcmeData) AddDomains ¶ added in v0.9.1
AddDomains ...
type AgentCheck ¶
AgentCheck ...
type Backend ¶
type Backend struct { // // core config // ID string Namespace string Name string Port string DNSPort string Endpoints []*Endpoint EpNaming EndpointNaming Paths []*BackendPath PathsMap *HostsMap // // per backend config // AgentCheck AgentCheck BalanceAlgorithm string BlueGreen BlueGreenConfig 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 []*BackendConfigWAF 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 BackendConfigWAF ¶ added in v0.9.1
type BackendConfigWAF struct { Paths BackendPaths Config WAF }
BackendConfigWAF defines Web Application Firewall Configurations
func (*BackendConfigWAF) String ¶ added in v0.9.1
func (b *BackendConfigWAF) String() string
String ...
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 // AcceptProxy bool ALPN string TLS []*BindTLSConfig // UseServerList *HostsMap CrtList *HostsMap }
BindConfig ...
type BindTLSConfig ¶
type BindTLSConfig struct { CAFilename string CAHash string CRLFilename string CRLHash string CrtFilename string CrtHash string Hostnames []string }
BindTLSConfig ...
type BlueGreenConfig ¶ added in v0.9.1
BlueGreenConfig ...
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 Label string 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 Bind 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 Prometheus PromConfig Stats StatsConfig StrictHost bool UseChroot bool UseHAProxyUser bool UseHTX 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 FrontingUseProto bool }
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 CRLFilename string CRLHash string TLSCommonName string TLSFilename string TLSHash string TLSNotAfter time.Time }
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 ...
func (*HostsMap) AppendItem ¶ added in v0.9.1
AppendItem adds a generic item to the HostsMap.
type ModSecurityConfig ¶
type ModSecurityConfig struct { Endpoints []string Timeout ModSecurityTimeoutConfig }
ModSecurityConfig ...
type ModSecurityTimeoutConfig ¶
type ModSecurityTimeoutConfig struct { // Backend Connect string Server string // SPOE Hello string Idle string Processing string }
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 BackendCiphers string BackendCipherSuites string BackendOptions string Ciphers string // TLS up to 1.2 CipherSuites string // TLS 1.3 DHParam DHParamConfig Engine string HeadersPrefix string ModeAsync bool Options string RedirectCode int }
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 Length int 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 ...