Documentation ¶
Index ¶
- Constants
- func CanonicalDomain(domain string) string
- func ServiceLabel(key, serviceName string) string
- type AccessLog
- type Auth
- type Backend
- type Basic
- type Buckets
- type CircuitBreaker
- type ClientTLS
- type Cluster
- type ConfigMessage
- type Configuration
- type Configurations
- type Constraint
- type Constraints
- type Datadog
- type Digest
- type ErrorPage
- type Forward
- type Frontend
- type Headers
- type HealthCheck
- type LoadBalancer
- type LoadBalancerMethod
- type MaxConn
- type Metrics
- type Prometheus
- type Route
- type Server
- type Statistics
- type Statsd
- type Store
- type Users
Constants ¶
const ( // LabelPrefix Traefik label LabelPrefix = "traefik." // LabelDomain Traefik label LabelDomain = LabelPrefix + "domain" // LabelEnable Traefik label LabelEnable = LabelPrefix + "enable" // LabelPort Traefik label LabelPort = LabelPrefix + "port" // LabelPortIndex Traefik label LabelPortIndex = LabelPrefix + "portIndex" // LabelProtocol Traefik label LabelProtocol = LabelPrefix + "protocol" // LabelTags Traefik label LabelTags = LabelPrefix + "tags" // LabelWeight Traefik label LabelWeight = LabelPrefix + "weight" // LabelFrontendAuthBasic Traefik label LabelFrontendAuthBasic = LabelPrefix + "frontend.auth.basic" // LabelFrontendEntryPoints Traefik label LabelFrontendEntryPoints = LabelPrefix + "frontend.entryPoints" // LabelFrontendPassHostHeader Traefik label LabelFrontendPassHostHeader = LabelPrefix + "frontend.passHostHeader" // LabelFrontendPriority Traefik label LabelFrontendPriority = LabelPrefix + "frontend.priority" // LabelFrontendRule Traefik label LabelFrontendRule = LabelPrefix + "frontend.rule" // LabelFrontendRuleType Traefik label LabelFrontendRuleType = LabelPrefix + "frontend.rule.type" // LabelTraefikFrontendValue Traefik label LabelTraefikFrontendValue = LabelPrefix + "frontend.value" // LabelTraefikFrontendWhitelistSourceRange Traefik label LabelTraefikFrontendWhitelistSourceRange = LabelPrefix + "frontend.whitelistSourceRange" // LabelBackend Traefik label LabelBackend = LabelPrefix + "backend" // LabelBackendID Traefik label LabelBackendID = LabelPrefix + "backend.id" // LabelTraefikBackendCircuitbreaker Traefik label LabelTraefikBackendCircuitbreaker = LabelPrefix + "backend.circuitbreaker" // LabelBackendCircuitbreakerExpression Traefik label LabelBackendCircuitbreakerExpression = LabelPrefix + "backend.circuitbreaker.expression" // LabelBackendHealthcheckPath Traefik label LabelBackendHealthcheckPath = LabelPrefix + "backend.healthcheck.path" // LabelBackendHealthcheckInterval Traefik label LabelBackendHealthcheckInterval = LabelPrefix + "backend.healthcheck.interval" // LabelBackendLoadbalancerMethod Traefik label LabelBackendLoadbalancerMethod = LabelPrefix + "backend.loadbalancer.method" // LabelBackendLoadbalancerSticky Traefik label LabelBackendLoadbalancerSticky = LabelPrefix + "backend.loadbalancer.sticky" // LabelBackendMaxconnAmount Traefik label LabelBackendMaxconnAmount = LabelPrefix + "backend.maxconn.amount" // LabelBackendMaxconnExtractorfunc Traefik label LabelBackendMaxconnExtractorfunc = LabelPrefix + "backend.maxconn.extractorfunc" )
Variables ¶
This section is empty.
Functions ¶
func CanonicalDomain ¶ added in v1.1.0
CanonicalDomain returns a lower case domain with trim space
func ServiceLabel ¶ added in v1.4.0
ServiceLabel converts a key value of Label*, given a serviceName, into a pattern <LabelPrefix>.<serviceName>.<property>
i.e. For LabelFrontendRule and serviceName=app it will return "traefik.app.frontend.rule"
Types ¶
type AccessLog ¶ added in v1.4.0
type AccessLog struct { FilePath string `json:"file,omitempty" description:"Access log file path. Stdout is used when omitted or empty"` Format string `json:"format,omitempty" description:"Access log format: json | common"` }
AccessLog holds the configuration settings for the access logger (middlewares/accesslog).
type Backend ¶
type Backend struct { Servers map[string]Server `json:"servers,omitempty"` CircuitBreaker *CircuitBreaker `json:"circuitBreaker,omitempty"` LoadBalancer *LoadBalancer `json:"loadBalancer,omitempty"` MaxConn *MaxConn `json:"maxConn,omitempty"` HealthCheck *HealthCheck `json:"healthCheck,omitempty"` }
Backend holds backend configuration.
type Buckets ¶ added in v1.2.0
type Buckets []float64
Buckets holds Prometheus Buckets
func (*Buckets) Set ¶ added in v1.2.0
Set adds strings elem into the the parser it splits str on "," and ";" and apply ParseFloat to string
type CircuitBreaker ¶
type CircuitBreaker struct {
Expression string `json:"expression,omitempty"`
}
CircuitBreaker holds circuit breaker configuration.
type ClientTLS ¶ added in v1.4.0
type ClientTLS struct { CA string `description:"TLS CA"` Cert string `description:"TLS cert"` Key string `description:"TLS key"` InsecureSkipVerify bool `description:"TLS insecure skip verify"` }
ClientTLS holds TLS specific configurations as client CA, Cert and Key can be either path or file contents
type ConfigMessage ¶
type ConfigMessage struct { ProviderName string Configuration *Configuration }
ConfigMessage hold configuration information exchanged between parts of traefik.
type Configuration ¶
type Configuration struct { Backends map[string]*Backend `json:"backends,omitempty"` Frontends map[string]*Frontend `json:"frontends,omitempty"` }
Configuration of a provider.
type Configurations ¶ added in v1.4.0
type Configurations map[string]*Configuration
Configurations is for currentConfigurations Map
type Constraint ¶
type Constraint struct { Key string // MustMatch is true if operator is "==" or false if operator is "!=" MustMatch bool // TODO: support regex Regex string }
Constraint hold a parsed constraint expresssion
func NewConstraint ¶
func NewConstraint(exp string) (*Constraint, error)
NewConstraint receive a string and return a *Constraint, after checking syntax and parsing the constraint expression
func (*Constraint) MarshalText ¶ added in v1.1.0
func (c *Constraint) MarshalText() (text []byte, err error)
MarshalText encodes the receiver into UTF-8-encoded text and returns the result.
func (*Constraint) MatchConstraintWithAtLeastOneTag ¶
func (c *Constraint) MatchConstraintWithAtLeastOneTag(tags []string) bool
MatchConstraintWithAtLeastOneTag tests a constraint for one single service
func (*Constraint) String ¶
func (c *Constraint) String() string
func (*Constraint) UnmarshalText ¶ added in v1.1.0
func (c *Constraint) UnmarshalText(text []byte) error
UnmarshalText define how unmarshal in TOML parsing
type Constraints ¶
type Constraints []*Constraint
Constraints holds a Constraint parser
func (*Constraints) SetValue ¶
func (cs *Constraints) SetValue(val interface{})
SetValue sets []*Constraint into the parser
func (*Constraints) String ¶
func (cs *Constraints) String() string
String returns []*Constraint in string
func (*Constraints) Type ¶
func (cs *Constraints) Type() string
Type exports the Constraints type as a string
type Datadog ¶ added in v1.4.0
type Datadog struct { Address string `description:"DataDog's address"` PushInterval string `description:"DataDog push interval"` }
Datadog contains address and metrics pushing interval configuration
type ErrorPage ¶ added in v1.4.0
type ErrorPage struct { Status []string `json:"status,omitempty"` Backend string `json:"backend,omitempty"` Query string `json:"query,omitempty"` }
ErrorPage holds custom error page configuration
type Forward ¶ added in v1.4.0
type Forward struct { Address string `description:"Authentication server address"` TLS *ClientTLS `description:"Enable TLS support"` TrustForwardHeader bool `description:"Trust X-Forwarded-* headers"` }
Forward authentication
type Frontend ¶
type Frontend struct { EntryPoints []string `json:"entryPoints,omitempty"` Backend string `json:"backend,omitempty"` Routes map[string]Route `json:"routes,omitempty"` PassHostHeader bool `json:"passHostHeader,omitempty"` PassTLSCert bool `json:"passTLSCert,omitempty"` Priority int `json:"priority"` BasicAuth []string `json:"basicAuth"` WhitelistSourceRange []string `json:"whitelistSourceRange,omitempty"` Headers Headers `json:"headers,omitempty"` Errors map[string]ErrorPage `json:"errors,omitempty"` }
Frontend holds frontend configuration.
type Headers ¶ added in v1.4.0
type Headers struct { CustomRequestHeaders map[string]string `json:"customRequestHeaders,omitempty"` CustomResponseHeaders map[string]string `json:"customResponseHeaders,omitempty"` AllowedHosts []string `json:"allowedHosts,omitempty"` HostsProxyHeaders []string `json:"hostsProxyHeaders,omitempty"` SSLRedirect bool `json:"sslRedirect,omitempty"` SSLTemporaryRedirect bool `json:"sslTemporaryRedirect,omitempty"` SSLHost string `json:"sslHost,omitempty"` SSLProxyHeaders map[string]string `json:"sslProxyHeaders,omitempty"` STSSeconds int64 `json:"stsSeconds,omitempty"` STSIncludeSubdomains bool `json:"stsIncludeSubdomains,omitempty"` STSPreload bool `json:"stsPreload,omitempty"` ForceSTSHeader bool `json:"forceSTSHeader,omitempty"` FrameDeny bool `json:"frameDeny,omitempty"` CustomFrameOptionsValue string `json:"customFrameOptionsValue,omitempty"` ContentTypeNosniff bool `json:"contentTypeNosniff,omitempty"` BrowserXSSFilter bool `json:"browserXssFilter,omitempty"` ContentSecurityPolicy string `json:"contentSecurityPolicy,omitempty"` PublicKey string `json:"publicKey,omitempty"` ReferrerPolicy string `json:"referrerPolicy,omitempty"` IsDevelopment bool `json:"isDevelopment,omitempty"` }
Headers holds the custom header configuration
func (Headers) HasCustomHeadersDefined ¶ added in v1.4.0
HasCustomHeadersDefined checks to see if any of the custom header elements have been set
func (Headers) HasSecureHeadersDefined ¶ added in v1.4.0
HasSecureHeadersDefined checks to see if any of the secure header elements have been set
type HealthCheck ¶ added in v1.2.0
type HealthCheck struct { Path string `json:"path,omitempty"` Port int `json:"port,omitempty"` Interval string `json:"interval,omitempty"` }
HealthCheck holds HealthCheck configuration
type LoadBalancer ¶
type LoadBalancer struct { Method string `json:"method,omitempty"` Sticky bool `json:"sticky,omitempty"` }
LoadBalancer holds load balancing configuration.
type LoadBalancerMethod ¶
type LoadBalancerMethod uint8
LoadBalancerMethod holds the method of load balancing to use.
const ( // Wrr (default) = Weighted Round Robin Wrr LoadBalancerMethod = iota // Drr = Dynamic Round Robin Drr )
func NewLoadBalancerMethod ¶
func NewLoadBalancerMethod(loadBalancer *LoadBalancer) (LoadBalancerMethod, error)
NewLoadBalancerMethod create a new LoadBalancerMethod from a given LoadBalancer.
type MaxConn ¶
type MaxConn struct { Amount int64 `json:"amount,omitempty"` ExtractorFunc string `json:"extractorFunc,omitempty"` }
MaxConn holds maximum connection configuration
type Metrics ¶ added in v1.2.0
type Metrics struct { Prometheus *Prometheus `description:"Prometheus metrics exporter type"` Datadog *Datadog `description:"DataDog metrics exporter type"` StatsD *Statsd `description:"StatsD metrics exporter type"` }
Metrics provides options to expose and send Traefik metrics to different third party monitoring systems
type Prometheus ¶ added in v1.2.0
type Prometheus struct {
Buckets Buckets `description:"Buckets for latency metrics"`
}
Prometheus can contain specific configuration used by the Prometheus Metrics exporter
type Route ¶
type Route struct {
Rule string `json:"rule,omitempty"`
}
Route holds route configuration.
type Statistics ¶ added in v1.2.0
type Statistics struct {
RecentErrors int `description:"Number of recent errors logged"`
}
Statistics provides options for monitoring request and response stats
type Statsd ¶ added in v1.4.0
type Statsd struct { Address string `description:"StatsD address"` PushInterval string `description:"DataDog push interval"` }
Statsd contains address and metrics pushing interval configuration