types

package
v2.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 14 Imported by: 8

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	// CommonFormat is the common logging format (CLF).
	CommonFormat string = "common"

	// JSONFormat is the JSON logging format.
	JSONFormat string = "json"
)

Variables

This section is empty.

Functions

func CanonicalDomain

func CanonicalDomain(domain string) string

CanonicalDomain returns a lower case domain with trim space.

func MatchDomain

func MatchDomain(domain, certDomain string) bool

MatchDomain returns true if a domain match the cert domain.

Types

type AccessLog

type AccessLog struct {
	FilePath      string            `` /* 151-byte string literal not displayed */
	Format        string            `` /* 132-byte string literal not displayed */
	Filters       *AccessLogFilters `` /* 162-byte string literal not displayed */
	Fields        *AccessLogFields  `description:"AccessLogFields." json:"fields,omitempty" toml:"fields,omitempty" yaml:"fields,omitempty" export:"true"`
	BufferingSize int64             `` /* 177-byte string literal not displayed */
}

AccessLog holds the configuration settings for the access logger (middlewares/accesslog).

func (*AccessLog) SetDefaults

func (l *AccessLog) SetDefaults()

SetDefaults sets the default values.

type AccessLogFields

type AccessLogFields struct {
	DefaultMode string            `` /* 152-byte string literal not displayed */
	Names       map[string]string `description:"Override mode for fields" json:"names,omitempty" toml:"names,omitempty" yaml:"names,omitempty" export:"true"`
	Headers     *FieldHeaders     `` /* 134-byte string literal not displayed */
}

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.

func (*AccessLogFields) SetDefaults

func (f *AccessLogFields) SetDefaults()

SetDefaults sets the default values.

type AccessLogFilters

type AccessLogFilters struct {
	StatusCodes   []string       `` /* 173-byte string literal not displayed */
	RetryAttempts bool           `` /* 171-byte string literal not displayed */
	MinDuration   types.Duration `` /* 185-byte string literal not displayed */
}

AccessLogFilters holds filters configuration.

type ClientTLS

type ClientTLS struct {
	CA string `description:"TLS CA" json:"ca,omitempty" toml:"ca,omitempty" yaml:"ca,omitempty"`
	// Deprecated: TLS client authentication is a server side option (see https://github.com/golang/go/blob/740a490f71d026bb7d2d13cb8fa2d6d6e0572b70/src/crypto/tls/common.go#L634).
	CAOptional         bool   `` /* 127-byte string literal not displayed */
	Cert               string `description:"TLS cert" json:"cert,omitempty" toml:"cert,omitempty" yaml:"cert,omitempty"`
	Key                string `description:"TLS key" json:"key,omitempty" toml:"key,omitempty" yaml:"key,omitempty" loggable:"false"`
	InsecureSkipVerify bool   `` /* 160-byte string literal not displayed */
}

ClientTLS holds TLS specific configurations as client CA, Cert and Key can be either path or file contents.

func (*ClientTLS) CreateTLSConfig

func (c *ClientTLS) CreateTLSConfig(ctx context.Context) (*tls.Config, error)

CreateTLSConfig creates a TLS config from ClientTLS structures.

func (*ClientTLS) DeepCopy added in v2.5.4

func (in *ClientTLS) DeepCopy() *ClientTLS

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientTLS.

func (*ClientTLS) DeepCopyInto added in v2.5.4

func (in *ClientTLS) DeepCopyInto(out *ClientTLS)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Datadog

type Datadog struct {
	Address              string         `description:"Datadog's address." json:"address,omitempty" toml:"address,omitempty" yaml:"address,omitempty"`
	PushInterval         types.Duration `` /* 140-byte string literal not displayed */
	AddEntryPointsLabels bool           `` /* 173-byte string literal not displayed */
	AddRoutersLabels     bool           `` /* 156-byte string literal not displayed */
	AddServicesLabels    bool           `` /* 160-byte string literal not displayed */
	Prefix               string         `` /* 137-byte string literal not displayed */
}

Datadog contains address and metrics pushing interval configuration.

func (*Datadog) SetDefaults

func (d *Datadog) SetDefaults()

SetDefaults sets the default values.

type Domain

type Domain struct {
	// Main defines the main domain name.
	Main string `description:"Default subject name." json:"main,omitempty" toml:"main,omitempty" yaml:"main,omitempty"`
	// SANs defines the subject alternative domain names.
	SANs []string `description:"Subject alternative names." json:"sans,omitempty" toml:"sans,omitempty" yaml:"sans,omitempty"`
}

Domain holds a domain name with SANs.

func (*Domain) DeepCopy

func (in *Domain) DeepCopy() *Domain

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Domain.

func (*Domain) DeepCopyInto

func (in *Domain) DeepCopyInto(out *Domain)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Domain) Set

func (d *Domain) Set(domains []string)

Set sets a domains from an array of strings.

func (*Domain) ToStrArray

func (d *Domain) ToStrArray() []string

ToStrArray convert a domain into an array of strings.

type FieldHeaders

type FieldHeaders struct {
	DefaultMode string            `` /* 160-byte string literal not displayed */
	Names       map[string]string `description:"Override mode for headers" json:"names,omitempty" toml:"names,omitempty" yaml:"names,omitempty" export:"true"`
}

FieldHeaders holds configuration for access log headers.

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   `` /* 168-byte string literal not displayed */
	ResolvConfig    string `` /* 152-byte string literal not displayed */
	ResolvDepth     int    `` /* 159-byte string literal not displayed */
}

HostResolverConfig contain configuration for CNAME Flattening.

func (*HostResolverConfig) SetDefaults

func (h *HostResolverConfig) SetDefaults()

SetDefaults sets the default values.

type InfluxDB

type InfluxDB struct {
	Address              string            `description:"InfluxDB address." json:"address,omitempty" toml:"address,omitempty" yaml:"address,omitempty"`
	Protocol             string            `` /* 132-byte string literal not displayed */
	PushInterval         types.Duration    `` /* 141-byte string literal not displayed */
	Database             string            `` /* 151-byte string literal not displayed */
	RetentionPolicy      string            `` /* 180-byte string literal not displayed */
	Username             string            `` /* 144-byte string literal not displayed */
	Password             string            `` /* 144-byte string literal not displayed */
	AddEntryPointsLabels bool              `` /* 173-byte string literal not displayed */
	AddRoutersLabels     bool              `` /* 156-byte string literal not displayed */
	AddServicesLabels    bool              `` /* 160-byte string literal not displayed */
	AdditionalLabels     map[string]string `` /* 178-byte string literal not displayed */
}

InfluxDB contains address, login and metrics pushing interval configuration.

func (*InfluxDB) SetDefaults

func (i *InfluxDB) SetDefaults()

SetDefaults sets the default values.

type InfluxDB2 added in v2.7.0

type InfluxDB2 struct {
	Address              string            `description:"InfluxDB v2 address." json:"address,omitempty" toml:"address,omitempty" yaml:"address,omitempty"`
	Token                string            `description:"InfluxDB v2 access token." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"`
	PushInterval         types.Duration    `` /* 144-byte string literal not displayed */
	Org                  string            `description:"InfluxDB v2 org ID." json:"org,omitempty" toml:"org,omitempty" yaml:"org,omitempty" export:"true"`
	Bucket               string            `description:"InfluxDB v2 bucket ID." json:"bucket,omitempty" toml:"bucket,omitempty" yaml:"bucket,omitempty" export:"true"`
	AddEntryPointsLabels bool              `` /* 173-byte string literal not displayed */
	AddRoutersLabels     bool              `` /* 156-byte string literal not displayed */
	AddServicesLabels    bool              `` /* 160-byte string literal not displayed */
	AdditionalLabels     map[string]string `` /* 178-byte string literal not displayed */
}

InfluxDB2 contains address, token and metrics pushing interval configuration.

func (*InfluxDB2) SetDefaults added in v2.7.0

func (i *InfluxDB2) SetDefaults()

SetDefaults sets the default values.

type Metrics

type Metrics struct {
	Prometheus *Prometheus `` /* 182-byte string literal not displayed */
	Datadog    *Datadog    `` /* 170-byte string literal not displayed */
	StatsD     *Statsd     `` /* 166-byte string literal not displayed */
	InfluxDB   *InfluxDB   `` /* 174-byte string literal not displayed */
	InfluxDB2  *InfluxDB2  `` /* 180-byte string literal not displayed */
}

Metrics provides options to expose and send Traefik metrics to different third party monitoring systems.

type Prometheus

type Prometheus struct {
	Buckets              []float64         `` /* 131-byte string literal not displayed */
	AddEntryPointsLabels bool              `` /* 173-byte string literal not displayed */
	AddRoutersLabels     bool              `` /* 156-byte string literal not displayed */
	AddServicesLabels    bool              `` /* 160-byte string literal not displayed */
	EntryPoint           string            `description:"EntryPoint" json:"entryPoint,omitempty" toml:"entryPoint,omitempty" yaml:"entryPoint,omitempty" export:"true"`
	ManualRouting        bool              `` /* 135-byte string literal not displayed */
	HeaderLabels         map[string]string `` /* 252-byte string literal not displayed */
}

Prometheus can contain specific configuration used by the Prometheus Metrics exporter.

func (*Prometheus) SetDefaults

func (p *Prometheus) SetDefaults()

SetDefaults sets the default values.

type RouteAppender

type RouteAppender interface {
	Append(systemRouter *mux.Router)
}

RouteAppender appends routes on a router (/api, /ping ...).

type Statistics

type Statistics struct {
	RecentErrors int `` /* 149-byte string literal not displayed */
}

Statistics provides options for monitoring request and response stats.

func (*Statistics) SetDefaults

func (s *Statistics) SetDefaults()

SetDefaults sets the default values.

type Statsd

type Statsd struct {
	Address              string         `description:"StatsD address." json:"address,omitempty" toml:"address,omitempty" yaml:"address,omitempty"`
	PushInterval         types.Duration `` /* 139-byte string literal not displayed */
	AddEntryPointsLabels bool           `` /* 173-byte string literal not displayed */
	AddRoutersLabels     bool           `` /* 156-byte string literal not displayed */
	AddServicesLabels    bool           `` /* 160-byte string literal not displayed */
	Prefix               string         `` /* 137-byte string literal not displayed */
}

Statsd contains address and metrics pushing interval configuration.

func (*Statsd) SetDefaults

func (s *Statsd) SetDefaults()

SetDefaults sets the default values.

type TraefikLog

type TraefikLog struct {
	Level    string `` /* 127-byte string literal not displayed */
	FilePath string `` /* 152-byte string literal not displayed */
	Format   string `` /* 133-byte string literal not displayed */
}

TraefikLog holds the configuration settings for the traefik logger.

func (*TraefikLog) SetDefaults

func (l *TraefikLog) SetDefaults()

SetDefaults sets the default values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL