Documentation
¶
Index ¶
- Constants
- Variables
- type AccessConfig
- type Acme
- type AcmeCerts
- type AcmeData
- type AcmeStorages
- func (c *AcmeStorages) Acquire(name string) *AcmeCerts
- func (c *AcmeStorages) BuildAcmeStorages() []string
- func (c *AcmeStorages) BuildAcmeStoragesAdd() []string
- func (c *AcmeStorages) BuildAcmeStoragesDel() []string
- func (c *AcmeStorages) Commit()
- func (c *AcmeStorages) RemoveAll(names []string)
- func (c *AcmeStorages) Updated() bool
- type AgentCheck
- type AuthExternal
- type AuthHTTP
- type AuthProxy
- type AuthProxyBind
- type Backend
- func (b *Backend) AcquireEndpoint(ip string, port int, targetRef string) *Endpoint
- func (b *Backend) AddEmptyEndpoint() *Endpoint
- func (b *Backend) AddEndpoint(ip string, port int, targetRef string) *Endpoint
- func (b *Backend) AddPath(path *Path)
- func (b *Backend) BackendID() BackendID
- func (b *Backend) CookieAffinity() bool
- func (b *Backend) Equals(other *Backend) bool
- func (b *Backend) FindEndpoint(target string) *Endpoint
- func (b *Backend) HasCorsEnabled() bool
- func (b *Backend) HasHSTS() bool
- func (b *Backend) HasHTTPPassUseProto() Has
- func (b *Backend) HasHTTPPassthrough() Has
- func (b *Backend) HasHTTPRequests() bool
- func (b *Backend) HasModsec() bool
- func (b *Backend) HasSSLRedirect() bool
- func (b *Backend) HasSSLRedirectPaths(paths []*Path) bool
- func (b *Backend) HasTLSAuth() bool
- func (b *Backend) Hostnames() []string
- func (b *Backend) NeedACL() bool
- func (b *Backend) NeedFrontendACL() bool
- func (b *Backend) PathConfig(attr string) *BackendPathConfig
- func (b *Backend) PathConfigs() map[string]*BackendPathConfig
- func (b *Backend) PathsMaps() []*BackendPathsMaps
- type BackendID
- type BackendLimit
- type BackendPathConfig
- type BackendPathItem
- type BackendPathsMaps
- type BackendRedirect
- type BackendTLSConfig
- type BackendTimeoutConfig
- type Backends
- func (b *Backends) AcquireAuthBackend(ipList []string, port int, hostname string) *Backend
- func (b *Backends) AcquireBackend(namespace, name, port string) *Backend
- func (b *Backends) AcquireNotFoundBackend() *Backend
- func (b *Backends) AcquireRedirectHTTPSBackend() *Backend
- func (b *Backends) AcquireStatusCodeBackend(code int) *Backend
- func (b *Backends) AcquireTCPRejectBackend() *Backend
- func (b *Backends) BackendChanged(backend *Backend)
- func (b *Backends) BuildHTTPResponses() (responses []HTTPResponses)
- func (b *Backends) BuildSortedItems() []*Backend
- func (b *Backends) BuildSortedShard(shardRef int) []*Backend
- func (b *Backends) BuildSupportBackendItems() []*Backend
- func (b *Backends) BuildUsedAuthBackends() map[string]bool
- func (b *Backends) Changed() bool
- func (b *Backends) ChangedShards() []int
- func (b *Backends) Clear()
- func (b *Backends) Commit()
- func (b *Backends) FillSourceIPs()
- func (b *Backends) FindBackend(namespace, name, port string) *Backend
- func (b *Backends) FindBackendID(backendID BackendID) *Backend
- func (b *Backends) HasBackend(name string) bool
- func (b *Backends) Items() map[string]*Backend
- func (b *Backends) ItemsAdd() map[string]*Backend
- func (b *Backends) ItemsDel() map[string]*Backend
- func (b *Backends) RemoveAll(backendID []string)
- func (b *Backends) Shrink()
- func (b *Backends) ShuffleAllEndpoints()
- func (b *Backends) SortChangedEndpoints(sortBy string)
- type BlueGreenConfig
- type CAVerify
- type Cookie
- type CookieConfig
- type Cors
- type DHParamConfig
- type DNSConfig
- type DNSNameserver
- type DNSResolver
- type DrainConfig
- type DynBackendConfig
- type DynScaling
- type Endpoint
- type EndpointCookieStrategy
- type EndpointNaming
- type ExternalConfig
- type Frontend
- func (f *Frontend) AcquireHost(hostname string) *Host
- func (f *Frontend) BuildSortedHosts() []*Host
- func (f *Frontend) Commit()
- func (f *Frontend) DefaultHost() *Host
- func (f *Frontend) FindHost(hostname string) *Host
- func (f *Frontend) FindTargetRedirect(redirfrom string, isRegex bool) *Host
- func (f *Frontend) HasCommit() bool
- func (f *Frontend) HasSSLPassthrough() bool
- func (f *Frontend) HasTLSAuth() bool
- func (f *Frontend) HasVarNamespace() bool
- func (f *Frontend) Hosts() map[string]*Host
- func (f *Frontend) HostsAdd() map[string]*Host
- func (f *Frontend) HostsChanged() bool
- func (f *Frontend) HostsDel() map[string]*Host
- func (f *Frontend) Port() int32
- func (f *Frontend) RemoveAllHosts(hostnames []string)
- func (f *Frontend) ShrinkHosts()
- func (f *Frontend) String() string
- type FrontendCommonMaps
- type FrontendHTTPMaps
- type FrontendHTTPSMaps
- type Frontends
- func (f *Frontends) AcquireFrontend(port int32, isHTTPS bool) *Frontend
- func (f *Frontends) BuildHTTPResponses() (responses []HTTPResponses)
- func (f *Frontends) Changed() bool
- func (f *Frontends) Commit()
- func (f *Frontends) FindFrontend(port int32) *Frontend
- func (f *Frontends) HasCommit() bool
- func (f *Frontends) HasHTTPResponses() bool
- func (f *Frontends) HasSomeHTTPPassUseProto() bool
- func (f *Frontends) HasSomeHTTPPassthrough() bool
- func (f *Frontends) Items() []*Frontend
- func (f *Frontends) RemoveAllHosts(hostnames []string)
- func (f *Frontends) RemoveEmptyFrontends()
- func (f *Frontends) Shrink()
- type Global
- type HSTS
- type HTTPHeader
- type HTTPHeaderMatch
- type HTTPMatch
- type HTTPResponse
- type HTTPResponses
- type Has
- type HealthCheck
- type HealthzConfig
- type Host
- func (h *Host) AddLink(backend *Backend, link *PathLink) *Path
- func (h *Host) AddLinkRedirect(link *PathLink, redirTo string) *Path
- func (h *Host) AddPath(backend *Backend, path string, match MatchType) *Path
- func (h *Host) AddRedirect(path string, match MatchType, redirTo string) *Path
- func (h *Host) Equals(other *Host) bool
- func (h *Host) FindPath(path string, match ...MatchType) (paths []*Path)
- func (h *Host) FindPathWithLink(link *PathLink) (path *Path)
- func (h *Host) HasTLSAuth() bool
- func (h *Host) RemovePath(hpath *Path)
- func (h *Host) String() string
- type HostAliasConfig
- type HostRedirectConfig
- type HostTLSConfig
- type HostsMap
- func (hm *HostsMap) AddAliasPathMapping(alias HostAliasConfig, path *Path, target string)
- func (hm *HostsMap) AddHostnameMapping(hostname string, extendedWildcard bool, target string)
- func (hm *HostsMap) AddHostnameMappingRegex(hostname, target string)
- func (hm *HostsMap) AddHostnamePathMapping(hostname string, path *Path, target string)
- func (hm *HostsMap) AddTargetIfMissing(hostname, path string, target string, match MatchType)
- func (hm *HostsMap) HasHost() bool
- func (hm *HostsMap) MatchFiles() []*MatchFile
- type HostsMapEntry
- type HostsMaps
- type MasterConfig
- type MatchFile
- type MatchType
- type ModSecurityConfig
- type ModSecurityTimeoutConfig
- type Path
- type PathLink
- func (l *PathLink) AddHeadersMatch(headers HTTPHeaderMatch) *PathLink
- func (l *PathLink) Equals(other *PathLink) bool
- func (l *PathLink) HAMatch() string
- func (l *PathLink) Hash() PathLinkHash
- func (l *PathLink) Hostname() string
- func (l *PathLink) IsComposeMatch() bool
- func (l *PathLink) IsDefaultHost() bool
- func (l *PathLink) IsEmpty() bool
- func (l *PathLink) Key() string
- func (l *PathLink) Less(other *PathLink, reversePath bool) bool
- func (l *PathLink) WithHTTPFront(front *Frontend) *PathLink
- func (l *PathLink) WithHTTPHost(host *Host) *PathLink
- func (l *PathLink) WithHeadersMatch(headers HTTPHeaderMatch) *PathLink
- func (l *PathLink) WithTCPHost(tcphost *TCPServiceHost) *PathLink
- type PathLinkHash
- type PeersConfig
- type PeersServer
- type PeersTable
- type ProcsConfig
- type PromConfig
- type RewriteConfig
- type SSLConfig
- type SecurityConfig
- type ServerConfig
- type StatsConfig
- type SyslogConfig
- type TCPBackend
- type TCPBackends
- type TCPEndpoint
- type TCPProxyProt
- type TCPSSL
- type TCPServiceHost
- type TCPServicePort
- func (s *TCPServicePort) AcquireDefaultHost() *TCPServiceHost
- func (s *TCPServicePort) AcquireTLSHost(hostname string) *TCPServiceHost
- func (s *TCPServicePort) BuildSortedItems() []*TCPServiceHost
- func (s *TCPServicePort) BuildSortedTLSConfig() []*TCPServiceTLSConfig
- func (s *TCPServicePort) DefaultHost() *TCPServiceHost
- func (s *TCPServicePort) HasTLS() bool
- func (s *TCPServicePort) Hosts() map[string]*TCPServiceHost
- func (s *TCPServicePort) Port() int
- type TCPServiceTLSConfig
- type TCPServices
- func (s *TCPServices) AcquireTCPPort(port int) *TCPServicePort
- func (s *TCPServices) AcquireTCPService(service string) (*TCPServicePort, *TCPServiceHost)
- func (s *TCPServices) BuildSortedItems() []*TCPServicePort
- func (s *TCPServices) Changed() bool
- func (s *TCPServices) Commit()
- func (s *TCPServices) FindTCPPort(port int) *TCPServicePort
- func (s *TCPServices) Items() map[int]*TCPServicePort
- func (s *TCPServices) RemoveAll(services []string)
- func (s *TCPServices) RemoveAllLinks(pathlinks ...*PathLink)
- func (s *TCPServices) RemoveService(service string)
- type TLSConfig
- type TimeoutConfig
- type User
- type Userlist
- type UserlistConfig
- type Userlists
- type WAF
Constants ¶
const ( MatchBegin = MatchType("begin") MatchExact = MatchType("exact") MatchPrefix = MatchType("prefix") MatchRegex = MatchType("regex") )
...
const DefaultHost = "<default>"
DefaultHost ...
const HTTPResponseGlobalID = "global"
const PeersGroupNameGlobal = "global"
const PeersTableNamePrefix = "_peers_"
Variables ¶
var DefaultMatchOrder = []MatchType{MatchExact, MatchPrefix, MatchBegin, MatchRegex}
DefaultMatchOrder ...
Functions ¶
This section is empty.
Types ¶
type AccessConfig ¶ added in v0.12.1
AccessConfig ...
type AcmeCerts ¶ added in v0.11.1
type AcmeCerts struct {
// contains filtered or unexported fields
}
AcmeCerts ...
func (*AcmeCerts) AddDomains ¶ added in v0.11.1
AddDomains ...
func (*AcmeCerts) AssignPreferredChain ¶ added in v0.13.5
AssignPreferredChain ...
type AcmeData ¶ added in v0.9.1
type AcmeData struct {
Emails string
Endpoint string
Expiring time.Duration
TermsAgreed bool
// contains filtered or unexported fields
}
AcmeData ...
func (*AcmeData) Storages ¶ added in v0.11.1
func (acme *AcmeData) Storages() *AcmeStorages
Storages ...
type AcmeStorages ¶ added in v0.11.1
type AcmeStorages struct {
// contains filtered or unexported fields
}
AcmeStorages ...
func (*AcmeStorages) Acquire ¶ added in v0.11.1
func (c *AcmeStorages) Acquire(name string) *AcmeCerts
Acquire ...
func (*AcmeStorages) BuildAcmeStorages ¶ added in v0.11.1
func (c *AcmeStorages) BuildAcmeStorages() []string
BuildAcmeStorages ...
func (*AcmeStorages) BuildAcmeStoragesAdd ¶ added in v0.11.1
func (c *AcmeStorages) BuildAcmeStoragesAdd() []string
BuildAcmeStoragesAdd ...
func (*AcmeStorages) BuildAcmeStoragesDel ¶ added in v0.11.1
func (c *AcmeStorages) BuildAcmeStoragesDel() []string
BuildAcmeStoragesDel ...
func (*AcmeStorages) RemoveAll ¶ added in v0.11.1
func (c *AcmeStorages) RemoveAll(names []string)
RemoveAll ...
type AgentCheck ¶
AgentCheck ...
type AuthExternal ¶ added in v0.13.0
type AuthExternal struct {
AllowedPath string
AlwaysDeny bool
AuthBackendName string
AuthPath string
HeadersFail []string
HeadersRequest []string
HeadersSucceed []string
HeadersVars map[string]string
Method string
RedirectOnFail string
}
AuthExternal ...
type AuthProxy ¶ added in v0.13.0
type AuthProxy struct {
BindList []*AuthProxyBind
Name string
RangeEnd int
RangeStart int
// contains filtered or unexported fields
}
AuthProxy ...
func (*AuthProxy) AcquireAuthBackendName ¶
func (proxy *AuthProxy) AcquireAuthBackendName(backend BackendID) (authBackendName string, err error)
AcquireAuthBackendName ...
func (*AuthProxy) RemoveAuthBackendByTarget ¶
RemoveAuthBackendByTarget ...
func (*AuthProxy) RemoveAuthBackendExcept ¶
RemoveAuthBackendExcept ...
type AuthProxyBind ¶ added in v0.13.0
AuthProxyBind ...
type Backend ¶
type Backend struct {
ID string
Code int
Namespace string
Name string
Port string
DNSPort string
SourceIPs []net.IP
Endpoints []*Endpoint
EpNaming EndpointNaming
//
// Paths
//
Paths []*Path
//
// per backend config
//
AgentCheck AgentCheck
AllowedIPTCP AccessConfig
BalanceAlgorithm string
BlueGreen BlueGreenConfig
Cookie Cookie
CustomConfigEarly []string
CustomConfigLate []string
CustomHTTPResponses HTTPResponses
DeniedIPTCP AccessConfig
Dynamic DynBackendConfig
EpCookieStrategy EndpointCookieStrategy
HealthCheck HealthCheck
Limit BackendLimit
ModeTCP bool
PeersTable string
Redirect BackendRedirect
RequestHeadersAdd []HTTPHeader
RequestHeadersSet []HTTPHeader
RequestHeadersDel []string
ResponseHeadersAdd []HTTPHeader
ResponseHeadersSet []HTTPHeader
ResponseHeadersDel []string
Resolver string
Server ServerConfig
Timeout BackendTimeoutConfig
TLS BackendTLSConfig
// contains filtered or unexported fields
}
Backend ...
func (*Backend) AcquireEndpoint ¶
AcquireEndpoint ...
func (*Backend) AddEmptyEndpoint ¶
AddEmptyEndpoint ...
func (*Backend) AddEndpoint ¶ added in v0.14.8
func (*Backend) CookieAffinity ¶ added in v0.12.1
CookieAffinity ...
func (*Backend) FindEndpoint ¶
FindEndpoint ...
func (*Backend) HasHTTPPassUseProto ¶
func (*Backend) HasHTTPPassthrough ¶
func (*Backend) HasHTTPRequests ¶
func (*Backend) HasSSLRedirectPaths ¶
HasSSLRedirectPaths ...
func (*Backend) HasTLSAuth ¶
func (*Backend) NeedFrontendACL ¶
func (*Backend) PathConfig ¶ added in v0.12.1
func (b *Backend) PathConfig(attr string) *BackendPathConfig
PathConfig ...
func (*Backend) PathConfigs ¶
func (b *Backend) PathConfigs() map[string]*BackendPathConfig
func (*Backend) PathsMaps ¶
func (b *Backend) PathsMaps() []*BackendPathsMaps
type BackendID ¶ added in v0.11.1
type BackendID struct {
Namespace string
Name string
Port string
// contains filtered or unexported fields
}
BackendID ...
type BackendLimit ¶
BackendLimit ...
type BackendPathConfig ¶ added in v0.12.1
type BackendPathConfig struct {
// contains filtered or unexported fields
}
BackendPathConfig ...
func (*BackendPathConfig) Items ¶ added in v0.12.1
func (b *BackendPathConfig) Items() []interface{}
Items ...
func (*BackendPathConfig) NeedACL ¶ added in v0.12.1
func (b *BackendPathConfig) NeedACL() bool
NeedACL ...
func (*BackendPathConfig) PathIDs ¶ added in v0.12.1
func (b *BackendPathConfig) PathIDs(index int) []string
PathIDs ...
func (*BackendPathConfig) Paths ¶ added in v0.12.1
func (b *BackendPathConfig) Paths(index int) []*Path
Paths ...
type BackendPathItem ¶ added in v0.12.1
type BackendPathItem struct {
// contains filtered or unexported fields
}
BackendPathItem ...
type BackendPathsMaps ¶
type BackendRedirect ¶
type BackendTLSConfig ¶
BackendTLSConfig ...
type BackendTimeoutConfig ¶
type BackendTimeoutConfig struct {
Connect string
HTTPRequest string
KeepAlive string
Queue string
Server string
ServerFin string
Tunnel string
}
BackendTimeoutConfig ...
type Backends ¶ added in v0.11.1
type Backends struct {
DefaultBackend *Backend
// contains filtered or unexported fields
}
Backends ...
func CreateBackends ¶ added in v0.11.1
CreateBackends ...
func (*Backends) AcquireAuthBackend ¶ added in v0.13.0
AcquireAuthBackend ...
func (*Backends) AcquireBackend ¶ added in v0.11.1
AcquireBackend ...
func (*Backends) AcquireNotFoundBackend ¶
AcquireNotFoundBackend ...
func (*Backends) AcquireRedirectHTTPSBackend ¶
AcquireHTTPSRedirectBackend ...
func (*Backends) AcquireStatusCodeBackend ¶
AcquireStatusCodeBackend ...
TODO: It currently supports only the following codes: 200, 400, 403, 404, 405, 408, 410, 413, 425, 429, 500, 501, 502, 503, 504 Need to improve the template to support others.
func (*Backends) AcquireTCPRejectBackend ¶
func (*Backends) BackendChanged ¶ added in v0.11.9
BackendChanged ...
func (*Backends) BuildHTTPResponses ¶ added in v0.16.0
func (b *Backends) BuildHTTPResponses() (responses []HTTPResponses)
func (*Backends) BuildSortedItems ¶ added in v0.11.1
BuildSortedItems ...
func (*Backends) BuildSortedShard ¶ added in v0.11.1
BuildSortedShard ...
func (*Backends) BuildSupportBackendItems ¶
func (*Backends) BuildUsedAuthBackends ¶ added in v0.13.0
BuildUsedAuthBackends ...
func (*Backends) ChangedShards ¶ added in v0.11.1
ChangedShards ...
func (*Backends) FillSourceIPs ¶ added in v0.13.0
func (b *Backends) FillSourceIPs()
FillSourceIPs ...
func (*Backends) FindBackend ¶ added in v0.11.1
FindBackend ...
func (*Backends) FindBackendID ¶ added in v0.11.1
FindBackendID ...
func (*Backends) HasBackend ¶
func (*Backends) Shrink ¶ added in v0.11.1
func (b *Backends) Shrink()
Shrink compares deleted and added backends with the same name - ie changed objects - and remove both from the changing hashmap tracker when they match.
func (*Backends) ShuffleAllEndpoints ¶ added in v0.11.1
func (b *Backends) ShuffleAllEndpoints()
ShuffleAllEndpoints ...
func (*Backends) SortChangedEndpoints ¶ added in v0.11.1
SortChangedEndpoints ...
type BlueGreenConfig ¶ added in v0.9.1
BlueGreenConfig ...
type Cookie ¶
type Cookie struct {
Name string
Domain string
Dynamic bool
Preserve bool
SameSite bool
Strategy string
Keywords string
}
Cookie ...
type Cors ¶
type Cors struct {
Enabled bool
//
AllowCredentials bool
AllowHeaders string
AllowMethods string
AllowOrigin []string
AllowOriginRegex []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 ¶
type DynBackendConfig struct {
BlockSize int
DynScaling DynScaling
MinFreeSlots int
}
DynBackendConfig ...
type DynScaling ¶
type DynScaling string
const ( DynScalingNone DynScaling = "None" DynScalingSlots DynScaling = "Slots" DynScalingAdd DynScaling = "Add" )
type Endpoint ¶
type Endpoint struct {
// revisit dynupdate.go/checkEndpointPair() whenever need to update these fields
Enabled bool
Label string
IP string
Name string
Port int
SourceIP string
Target string
TargetRef string
Weight int
CookieValue string
PUID int32 // Proxy Unique ID, referenced as "id" in haproxy server lines
}
Endpoint ...
type EndpointCookieStrategy ¶ added in v0.12.1
type EndpointCookieStrategy int
EndpointCookieStrategy ...
const ( EpCookieName EndpointCookieStrategy = iota EpCookiePodUID )
...
type EndpointNaming ¶
type EndpointNaming int
EndpointNaming ...
const ( EpSequence EndpointNaming = iota EpIPPort EpTargetRef )
...
type ExternalConfig ¶ added in v0.12.1
ExternalConfig ...
type Frontend ¶
type Frontend struct {
HTTPMaps *FrontendHTTPMaps
HTTPSMaps *FrontendHTTPSMaps
Name string
IsHTTPS bool
//
// Bind related
Bind string
AcceptProxy bool
//
// HTTPS related
CrtListFile string
StrictTLS bool
//
// Passthrough related
TLSProxyName string
HTTPSSocket string
HTTPSProxy bool
//
HTTPPassthrough bool
HTTPPassUseProto bool
RedirectFromCode int
RedirectToCode int
// contains filtered or unexported fields
}
Frontend ...
func (*Frontend) AcquireHost ¶
AcquireHost ...
func (*Frontend) BuildSortedHosts ¶
BuildSortedHosts ...
func (*Frontend) FindTargetRedirect ¶
FindTargetRedirect ...
func (*Frontend) HasSSLPassthrough ¶
HasSSLPassthrough ...
func (*Frontend) RemoveAllHosts ¶
RemoveAllHosts ...
func (*Frontend) ShrinkHosts ¶
func (f *Frontend) ShrinkHosts()
ShrinkHosts removes matching added and deleted hosts from the changing hashmap tracker that has the same content. A matching added+deleted pair means that a hostname was reparsed but its content wasn't changed.
type FrontendCommonMaps ¶
type FrontendCommonMaps struct {
DefaultHostMap *HostsMap
RedirFromMap *HostsMap
RedirFromRootMap *HostsMap
RedirToMap *HostsMap
VarNamespaceMap *HostsMap
}
FrontendCommonMaps ...
type FrontendHTTPMaps ¶
type FrontendHTTPMaps struct {
FrontendCommonMaps
HTTPHostMap *HostsMap
RedirRootSSLMap *HostsMap
}
FrontendHTTPMaps ...
type FrontendHTTPSMaps ¶
type FrontendHTTPSMaps struct {
FrontendCommonMaps
HTTPSHostMap *HostsMap
SSLPassthroughMap *HostsMap
TLSOffloadMap *HostsMap
TLSAuthList *HostsMap
TLSInvalidCrtPagesMap *HostsMap
TLSMissingCrtPagesMap *HostsMap
TLSNeedCrtList *HostsMap
}
FrontendHTTPSMaps ...
type Frontends ¶
type Frontends struct {
AuthProxy AuthProxy
DefaultCrtFile string
DefaultCrtHash string
// contains filtered or unexported fields
}
Frontends ...
func (*Frontends) AcquireFrontend ¶
func (*Frontends) BuildHTTPResponses ¶
func (f *Frontends) BuildHTTPResponses() (responses []HTTPResponses)
func (*Frontends) FindFrontend ¶
func (*Frontends) HasHTTPResponses ¶
func (*Frontends) HasSomeHTTPPassUseProto ¶
func (*Frontends) HasSomeHTTPPassthrough ¶
func (*Frontends) RemoveAllHosts ¶
func (*Frontends) RemoveEmptyFrontends ¶
func (f *Frontends) RemoveEmptyFrontends()
type Global ¶
type Global struct {
Procs ProcsConfig
Syslog SyslogConfig
MaxConn int
Timeout TimeoutConfig
SSL SSLConfig
DNS DNSConfig
ModSecurity ModSecurityConfig
Cookie CookieConfig
DrainSupport DrainConfig
Acme Acme
ForwardFor string
OriginalForwardedForHdr string
RealIPHdr string
LoadServerState bool
AdminSocket string
LocalFSPrefix string
External ExternalConfig
Healthz HealthzConfig
Master MasterConfig
MatchOrder []MatchType
Peers PeersConfig
Prometheus PromConfig
Security SecurityConfig
Stats StatsConfig
TCPBindIP string
CloseSessionsDuration time.Duration
TimeoutStopDuration time.Duration
StrictHost bool
FastCGIApps []string
DefaultBackendRedir string
DefaultBackendRedirCode int
NoRedirects []string
CustomConfig []string
CustomDefaults []string
CustomFrontendEarly []string
CustomFrontendLate []string
CustomPeers []string
CustomProxy map[string][]string
CustomHTTPResponses HTTPResponses
CustomSections []string
CustomTCP []string
}
Global ...
type HTTPHeader ¶ added in v0.14.0
HTTPHeader ...
type HTTPMatch ¶ added in v0.15.0
type HTTPMatch struct {
// Each HTTPMatch uses 16 + len(Name) + len(Value) + 7 (if Regex) bytes.
// Keyword and converter uses about 120 bytes.
//
// Three HTTPMatch whose Name has 24 bytes and Value has 256 bytes will consume:
// 3 * (16 + 24 + 256) + 120 = 1008, or 1029 if Regex is true
//
// This should be below 2048.
Regex bool
Name string
Value string
}
HTTPMatch ...
type HTTPResponse ¶ added in v0.14.0
type HTTPResponse struct {
Name string
Headers []HTTPHeader
Body []string
StatusCode int
StatusReason string
}
HTTPResponse ...
type HTTPResponses ¶ added in v0.16.0
type HTTPResponses struct {
ID string
HAProxy []HTTPResponse
Lua []HTTPResponse
}
HTTPResponses ...
type HealthCheck ¶
type HealthCheck struct {
Addr string
FallCount int
Interval string
Port int
RiseCount int
URI string
}
HealthCheck ...
type Host ¶
type Host struct {
ID string
Frontend *Frontend
Hostname string
Paths []*Path
//
Alias HostAliasConfig
CustomHTTPResponses HTTPResponses
DefaultBackend *Backend
ExtendedWildcard bool
Redirect HostRedirectConfig
RootRedirect string
SSLPassthrough bool
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.
func (*Host) AddLinkRedirect ¶ added in v0.15.0
AddLinkRedirect ...
func (*Host) AddRedirect ¶ added in v0.13.0
AddRedirect ...
func (*Host) FindPathWithLink ¶ added in v0.15.0
FindPathWithLink ...
type HostAliasConfig ¶
HostAliasConfig ...
type HostRedirectConfig ¶ added in v0.13.0
HostRedirectConfig ...
type HostTLSConfig ¶
HostTLSConfig ...
type HostsMap ¶
type HostsMap struct {
// contains filtered or unexported fields
}
HostsMap ...
func (*HostsMap) AddAliasPathMapping ¶ added in v0.11.1
func (hm *HostsMap) AddAliasPathMapping(alias HostAliasConfig, path *Path, target string)
AddAliasPathMapping ...
func (*HostsMap) AddHostnameMapping ¶ added in v0.11.1
AddHostnameMapping ...
func (*HostsMap) AddHostnameMappingRegex ¶ added in v0.13.0
AddHostnameMappingRegex ...
func (*HostsMap) AddHostnamePathMapping ¶ added in v0.11.1
AddHostnamePathMapping ...
func (*HostsMap) AddTargetIfMissing ¶
AddTargetIfMissing ...
func (*HostsMap) MatchFiles ¶ added in v0.11.2
MatchFiles ...
type HostsMapEntry ¶
HostsMapEntry ...
func (*HostsMapEntry) String ¶ added in v0.11.1
func (he *HostsMapEntry) String() string
type HostsMaps ¶
type HostsMaps struct {
Items []*HostsMap
// contains filtered or unexported fields
}
HostsMaps ...
type MasterConfig ¶ added in v0.12.1
MasterConfig ...
type MatchFile ¶ added in v0.11.2
type MatchFile struct {
// contains filtered or unexported fields
}
MatchFile ...
func (MatchFile) Headers ¶ added in v0.15.0
func (m MatchFile) Headers() HTTPHeaderMatch
Headers ...
type ModSecurityConfig ¶
type ModSecurityConfig struct {
Endpoints []string
Timeout ModSecurityTimeoutConfig
Args []string
UseCoraza bool
}
ModSecurityConfig ...
type ModSecurityTimeoutConfig ¶
type ModSecurityTimeoutConfig struct {
// Backend
Connect string
Server string
// SPOE
Hello string
Idle string
Processing string
}
ModSecurityTimeoutConfig ...
type Path ¶
type Path struct {
ID string `class:"core"`
Link *PathLink `class:"core"`
Host *Host `class:"core"`
Backend *Backend `class:"core"`
HasHTTPS bool `class:"core"`
//
// config fields
//
AllowedIPHTTP AccessConfig
AuthHTTP AuthHTTP
AuthExtFront AuthExternal
AuthExtBack AuthExternal
Cors Cors
DeniedIPHTTP AccessConfig
HSTS HSTS
MaxBodySize int64
RedirTo string
Rewrite RewriteConfig
SSLRedirect bool
WAF WAF
// contains filtered or unexported fields
}
BackendPath ...
type PathLink ¶ added in v0.11.1
type PathLink struct {
// contains filtered or unexported fields
}
PathLink is a unique identifier of a request configuration. Several request based configurations uses this identifier to distinguish if an acl should or should not be applied.
func CreatePathLink ¶ added in v0.11.1
func (*PathLink) AddHeadersMatch ¶ added in v0.15.0
func (l *PathLink) AddHeadersMatch(headers HTTPHeaderMatch) *PathLink
AddHeadersMatch ...
func (*PathLink) IsComposeMatch ¶
IsComposeMatch returns true if the pathLink has composing match, by adding method, header or cookie match.
func (*PathLink) IsDefaultHost ¶ added in v0.12.4
IsDefaultHost ...
func (*PathLink) WithHTTPFront ¶
WithHTTPFront ...
func (*PathLink) WithHTTPHost ¶
WithHTTPHost ...
func (*PathLink) WithHeadersMatch ¶ added in v0.15.0
func (l *PathLink) WithHeadersMatch(headers HTTPHeaderMatch) *PathLink
WithHeadersMatch ...
func (*PathLink) WithTCPHost ¶
func (l *PathLink) WithTCPHost(tcphost *TCPServiceHost) *PathLink
WithTCPHost ...
type PeersConfig ¶ added in v0.16.0
type PeersConfig struct {
SectionName string
LocalPeer PeersServer
GlobalTable string // used by global updater
Servers []PeersServer
Tables []PeersTable // updated on config.SyncConfig(), including global and backend tables
}
PeersConfig ...
type PeersServer ¶ added in v0.16.0
PeersServer ...
type PeersTable ¶ added in v0.16.0
PeersTable ...
type RewriteConfig ¶ added in v0.14.12
RewriteConfig ...
type SSLConfig ¶
type SSLConfig struct {
ALPN string
BackendCiphers string
BackendCipherSuites string
Ciphers string // TLS up to 1.2
CipherSuites string // TLS 1.3
DefaultCAFilename string
DefaultCAHash string
DefaultCRLFilename string
DefaultCRLHash string
DHParam DHParamConfig
Engine string
HeadersPrefix string
ModeAsync bool
Options string
RedirectCode int
SSLRedirect bool
}
SSLConfig ...
type SecurityConfig ¶ added in v0.12.1
SecurityConfig ...
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
FastCGIApp string
InitialWeight int
MaxConn int
MaxQueue int
Options string
Protocol string
Secure bool
SendProxy string
SNI string
VerifyHost 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
Length int
Tag string
//
AuthLogFormat string
HTTPLogFormat string
HTTPSLogFormat 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 TCPBackends ¶ added in v0.11.1
type TCPBackends struct {
// contains filtered or unexported fields
}
TCPBackends ...
func CreateTCPBackends ¶ added in v0.11.1
func CreateTCPBackends() *TCPBackends
CreateTCPBackends ...
func (*TCPBackends) Acquire ¶ added in v0.11.1
func (b *TCPBackends) Acquire(servicename string, port int) *TCPBackend
Acquire ...
func (*TCPBackends) BuildSortedItems ¶ added in v0.11.1
func (b *TCPBackends) BuildSortedItems() []*TCPBackend
BuildSortedItems ...
type TCPEndpoint ¶
TCPEndpoint ...
type TCPServiceHost ¶ added in v0.13.0
type TCPServiceHost struct {
Backend BackendID
// contains filtered or unexported fields
}
TCPServiceHost ...
func (*TCPServiceHost) Hostname ¶ added in v0.13.0
func (s *TCPServiceHost) Hostname() string
Hostname ...
type TCPServicePort ¶ added in v0.13.0
type TCPServicePort struct {
CustomConfig []string
LogFormat string
ProxyProt bool
TLS map[string]*TCPServiceTLSConfig
//
SNIMap *HostsMap
// contains filtered or unexported fields
}
TCPServicePort ...
func (*TCPServicePort) AcquireDefaultHost ¶
func (s *TCPServicePort) AcquireDefaultHost() *TCPServiceHost
func (*TCPServicePort) AcquireTLSHost ¶
func (s *TCPServicePort) AcquireTLSHost(hostname string) *TCPServiceHost
func (*TCPServicePort) BuildSortedItems ¶ added in v0.13.0
func (s *TCPServicePort) BuildSortedItems() []*TCPServiceHost
BuildSortedItems ...
func (*TCPServicePort) BuildSortedTLSConfig ¶ added in v0.14.8
func (s *TCPServicePort) BuildSortedTLSConfig() []*TCPServiceTLSConfig
BuildSortedTLSConfig ...
func (*TCPServicePort) DefaultHost ¶ added in v0.13.0
func (s *TCPServicePort) DefaultHost() *TCPServiceHost
DefaultHost ...
func (*TCPServicePort) Hosts ¶ added in v0.13.0
func (s *TCPServicePort) Hosts() map[string]*TCPServiceHost
Hosts ...
type TCPServiceTLSConfig ¶ added in v0.14.8
type TCPServices ¶ added in v0.13.0
type TCPServices struct {
// contains filtered or unexported fields
}
TCPServices ...
func CreateTCPServices ¶ added in v0.13.0
func CreateTCPServices() *TCPServices
CreateTCPServices ...
func (*TCPServices) AcquireTCPPort ¶
func (s *TCPServices) AcquireTCPPort(port int) *TCPServicePort
func (*TCPServices) AcquireTCPService ¶ added in v0.13.0
func (s *TCPServices) AcquireTCPService(service string) (*TCPServicePort, *TCPServiceHost)
AcquireTCPService ...
func (*TCPServices) BuildSortedItems ¶ added in v0.13.0
func (s *TCPServices) BuildSortedItems() []*TCPServicePort
BuildSortedItems ...
func (*TCPServices) FindTCPPort ¶ added in v0.13.0
func (s *TCPServices) FindTCPPort(port int) *TCPServicePort
FindTCPPort ...
func (*TCPServices) Items ¶ added in v0.13.0
func (s *TCPServices) Items() map[int]*TCPServicePort
Items ...
func (*TCPServices) RemoveAll ¶ added in v0.13.0
func (s *TCPServices) RemoveAll(services []string)
RemoveAll removes services declared as a slice of <hostname>:<port>
func (*TCPServices) RemoveAllLinks ¶
func (s *TCPServices) RemoveAllLinks(pathlinks ...*PathLink)
func (*TCPServices) RemoveService ¶ added in v0.13.0
func (s *TCPServices) RemoveService(service string)
RemoveService ...
type TLSConfig ¶ added in v0.13.0
type TLSConfig struct {
ALPN string
CAFilename string
CAHash string
CAVerify CAVerify
Ciphers string
CipherSuites string
CRLFilename string
CRLHash string
Options string
TLSCommonName string
TLSFilename string
TLSHash string
TLSNotAfter time.Time
}
TLSConfig ...
func (*TLSConfig) CAVerifyOptional ¶ added in v0.13.0
CAVerifyOptional ...
type TimeoutConfig ¶
type TimeoutConfig struct {
BackendTimeoutConfig
Client string
ClientFin string
Stats string
Stop string
}
TimeoutConfig ...