Documentation ¶
Index ¶
- Constants
- func CanonicalDomain(domain string) string
- func MatchDomain(domain string, certDomain string) bool
- type AccessLog
- type AccessLogFields
- type AccessLogFilters
- type Buckets
- type ClientTLS
- type Constraint
- type Constraints
- type DNSResolvers
- type Datadog
- type Domain
- type Domains
- type FieldHeaderNames
- type FieldHeaders
- type FieldNames
- type HTTPCodeRanges
- type HostResolverConfig
- type InfluxDB
- type Metrics
- type Prometheus
- type RouteAppender
- type Statistics
- type Statsd
- type StatusCodes
- type TraefikLog
Constants ¶
const ( // AccessLogKeep is the keep string value AccessLogKeep = "keep" // AccessLogDrop is the drop string value AccessLogDrop = "drop" // AccessLogRedact is the redact string value AccessLogRedact = "redact" )
Variables ¶
This section is empty.
Functions ¶
func CanonicalDomain ¶
CanonicalDomain returns a lower case domain with trim space.
func MatchDomain ¶
MatchDomain returns true if a domain match the cert domain.
Types ¶
type AccessLog ¶
type AccessLog struct { FilePath string `json:"file,omitempty" description:"Access log file path. Stdout is used when omitted or empty" export:"true"` Format string `json:"format,omitempty" description:"Access log format: json | common" export:"true"` Filters *AccessLogFilters `json:"filters,omitempty" description:"Access log filters, used to keep only specific access logs" export:"true"` Fields *AccessLogFields `json:"fields,omitempty" description:"AccessLogFields" export:"true"` BufferingSize int64 `` /* 126-byte string literal not displayed */ }
AccessLog holds the configuration settings for the access logger (middlewares/accesslog).
type AccessLogFields ¶
type AccessLogFields struct { DefaultMode string `json:"defaultMode,omitempty" description:"Default mode for fields: keep | drop" export:"true"` Names FieldNames `json:"names,omitempty" description:"Override mode for fields" export:"true"` Headers *FieldHeaders `json:"headers,omitempty" description:"Headers to keep, drop or redact" export:"true"` }
AccessLogFields holds configuration for access log fields
func (*AccessLogFields) Keep ¶
func (f *AccessLogFields) Keep(field string) bool
Keep check if the field need to be kept or dropped
func (*AccessLogFields) KeepHeader ¶
func (f *AccessLogFields) KeepHeader(header string) string
KeepHeader checks if the headers need to be kept, dropped or redacted and returns the status
type AccessLogFilters ¶
type AccessLogFilters struct { StatusCodes StatusCodes `json:"statusCodes,omitempty" description:"Keep access logs with status codes in the specified range" export:"true"` RetryAttempts bool `json:"retryAttempts,omitempty" description:"Keep access logs when at least one retry happened" export:"true"` MinDuration parse.Duration `json:"duration,omitempty" description:"Keep access logs when request took longer than the specified duration" export:"true"` }
AccessLogFilters holds filters configuration
type Buckets ¶
type Buckets []float64
Buckets holds Prometheus Buckets
func (*Buckets) Set ¶
Set adds strings elem into the the parser it splits str on "," and ";" and apply ParseFloat to string
type ClientTLS ¶
type ClientTLS struct { CA string `description:"TLS CA" json:"ca,omitempty"` CAOptional bool `description:"TLS CA.Optional" json:"caOptional,omitempty"` Cert string `description:"TLS cert" json:"cert,omitempty"` Key string `description:"TLS key" json:"key,omitempty"` InsecureSkipVerify bool `description:"TLS insecure skip verify" json:"insecureSkipVerify,omitempty"` }
ClientTLS holds TLS specific configurations as client CA, Cert and Key can be either path or file contents
type Constraint ¶
type Constraint struct { Key string `export:"true"` // MustMatch is true if operator is "==" or false if operator is "!=" MustMatch bool `export:"true"` // TODO: support regex Regex string `export:"true"` }
Constraint holds a parsed constraint expression.
func NewConstraint ¶
func NewConstraint(exp string) (*Constraint, error)
NewConstraint receives a string and return a *Constraint, after checking syntax and parsing the constraint expression.
func (*Constraint) MarshalText ¶
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 ¶
func (c *Constraint) UnmarshalText(text []byte) error
UnmarshalText defines 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 DNSResolvers ¶
type DNSResolvers []string
DNSResolvers is a list of DNSes that we will try to resolve the challenged FQDN against
func (*DNSResolvers) Get ¶
func (r *DNSResolvers) Get() interface{}
Get return the DNSResolvers list
func (*DNSResolvers) Set ¶
func (r *DNSResolvers) Set(value string) error
Set is the method to set the flag value, part of the flag.Value interface. Set's argument is a string to be parsed to set the flag. It's a comma-separated list, so we split it.
func (*DNSResolvers) SetValue ¶
func (r *DNSResolvers) SetValue(val interface{})
SetValue sets the DNSResolvers list
func (*DNSResolvers) String ¶
func (r *DNSResolvers) String() string
String is the method to format the flag's value, part of the flag.Value interface. The String method's output will be used in diagnostics.
type Datadog ¶
type Datadog struct { Address string `description:"DataDog's address"` PushInterval string `description:"DataDog push interval" export:"true"` }
Datadog contains address and metrics pushing interval configuration
type Domain ¶
Domain holds a domain name with SANs.
func (*Domain) ToStrArray ¶
ToStrArray convert a domain into an array of strings.
type Domains ¶
type Domains []Domain
Domains parse []Domain.
type FieldHeaderNames ¶
FieldHeaderNames holds maps of fields with specific mode
func (*FieldHeaderNames) Get ¶
func (f *FieldHeaderNames) Get() interface{}
Get return the FieldHeaderNames map
func (*FieldHeaderNames) Set ¶
func (f *FieldHeaderNames) Set(value string) error
Set is the method to set the flag value, part of the flag.Value interface. Set's argument is a string to be parsed to set the flag. It's a space-separated list, so we split it.
func (*FieldHeaderNames) SetValue ¶
func (f *FieldHeaderNames) SetValue(val interface{})
SetValue sets the FieldHeaderNames map with val
func (*FieldHeaderNames) String ¶
func (f *FieldHeaderNames) String() string
String is the method to format the flag's value, part of the flag.Value interface. The String method's output will be used in diagnostics.
type FieldHeaders ¶
type FieldHeaders struct { DefaultMode string `json:"defaultMode,omitempty" description:"Default mode for fields: keep | drop | redact" export:"true"` Names FieldHeaderNames `json:"names,omitempty" description:"Override mode for headers" export:"true"` }
FieldHeaders holds configuration for access log headers
type FieldNames ¶
FieldNames holds maps of fields with specific mode
func (*FieldNames) Set ¶
func (f *FieldNames) Set(value string) error
Set is the method to set the flag value, part of the flag.Value interface. Set's argument is a string to be parsed to set the flag. It's a space-separated list, so we split it.
func (*FieldNames) SetValue ¶
func (f *FieldNames) SetValue(val interface{})
SetValue sets the FieldNames map with val
func (*FieldNames) String ¶
func (f *FieldNames) String() string
String is the method to format the flag's value, part of the flag.Value interface. The String method's output will be used in diagnostics.
type HTTPCodeRanges ¶
type HTTPCodeRanges [][2]int
HTTPCodeRanges holds HTTP code ranges
func NewHTTPCodeRanges ¶
func NewHTTPCodeRanges(strBlocks []string) (HTTPCodeRanges, error)
NewHTTPCodeRanges creates HTTPCodeRanges from a given []string. Break out the http status code ranges into a low int and high int for ease of use at runtime
func (HTTPCodeRanges) Contains ¶
func (h HTTPCodeRanges) Contains(statusCode int) bool
Contains tests whether the passed status code is within one of its HTTP code ranges.
type HostResolverConfig ¶
type HostResolverConfig struct { CnameFlattening bool `description:"A flag to enable/disable CNAME flattening" export:"true"` ResolvConfig string `description:"resolv.conf used for DNS resolving" export:"true"` ResolvDepth int `description:"The maximal depth of DNS recursive resolving" export:"true"` }
HostResolverConfig contain configuration for CNAME Flattening.
type InfluxDB ¶
type InfluxDB struct { Address string `description:"InfluxDB address"` Protocol string `description:"InfluxDB address protocol (udp or http)"` PushInterval string `description:"InfluxDB push interval" export:"true"` Database string `description:"InfluxDB database used when protocol is http" export:"true"` RetentionPolicy string `description:"InfluxDB retention policy used when protocol is http" export:"true"` Username string `description:"InfluxDB username (only with http)" export:"true"` Password string `description:"InfluxDB password (only with http)" export:"true"` }
InfluxDB contains address, login and metrics pushing interval configuration
type Metrics ¶
type Metrics struct { Prometheus *Prometheus `description:"Prometheus metrics exporter type" export:"true"` Datadog *Datadog `description:"DataDog metrics exporter type" export:"true"` StatsD *Statsd `description:"StatsD metrics exporter type" export:"true"` InfluxDB *InfluxDB `description:"InfluxDB metrics exporter type"` }
Metrics provides options to expose and send Traefik metrics to different third party monitoring systems
type Prometheus ¶
type Prometheus struct { Buckets Buckets `description:"Buckets for latency metrics" export:"true"` EntryPoint string `description:"EntryPoint" export:"true"` Middlewares []string `description:"Middlewares" export:"true"` }
Prometheus can contain specific configuration used by the Prometheus Metrics exporter
type RouteAppender ¶
RouteAppender appends routes on a router (/api, /ping ...)
type Statistics ¶
type Statistics struct {
RecentErrors int `description:"Number of recent errors logged" export:"true"`
}
Statistics provides options for monitoring request and response stats
type Statsd ¶
type Statsd struct { Address string `description:"StatsD address"` PushInterval string `description:"StatsD push interval" export:"true"` }
Statsd contains address and metrics pushing interval configuration
type StatusCodes ¶
type StatusCodes []string
StatusCodes holds status codes ranges to filter access log
func (*StatusCodes) Set ¶
func (s *StatusCodes) Set(str string) error
Set adds strings elem into the the parser it splits str on , and ;
func (*StatusCodes) SetValue ¶
func (s *StatusCodes) SetValue(val interface{})
SetValue sets StatusCodes into the parser
type TraefikLog ¶
type TraefikLog struct { LogLevel string `description:"Log level set to traefik logs." export:"true"` FilePath string `json:"file,omitempty" description:"Traefik log file path. Stdout is used when omitted or empty"` Format string `json:"format,omitempty" description:"Traefik log format: json | common"` }
TraefikLog holds the configuration settings for the traefik logger.