configuration

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultInternalEntryPointName the name of the default internal entry point
	DefaultInternalEntryPointName = "traefik"

	// DefaultHealthCheckInterval is the default health check interval.
	DefaultHealthCheckInterval = 30 * time.Second

	// DefaultDialTimeout when connecting to a backend server.
	DefaultDialTimeout = 30 * time.Second

	// DefaultIdleTimeout before closing an idle connection.
	DefaultIdleTimeout = 180 * time.Second

	// DefaultGraceTimeout controls how long Traefik serves pending requests
	// prior to shutting down.
	DefaultGraceTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultEntryPoints

type DefaultEntryPoints []string

DefaultEntryPoints holds default entry points

func (*DefaultEntryPoints) Get

func (dep *DefaultEntryPoints) Get() interface{}

Get return the EntryPoints map

func (*DefaultEntryPoints) Set

func (dep *DefaultEntryPoints) 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 (*DefaultEntryPoints) SetValue

func (dep *DefaultEntryPoints) SetValue(val interface{})

SetValue sets the EntryPoints map with val

func (*DefaultEntryPoints) String

func (dep *DefaultEntryPoints) 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.

func (*DefaultEntryPoints) Type

func (dep *DefaultEntryPoints) Type() string

Type is type of the struct

type EntryPoint

type EntryPoint struct {
	Network              string
	Address              string
	TLS                  *tls.TLS        `export:"true"`
	Redirect             *types.Redirect `export:"true"`
	Auth                 *types.Auth     `export:"true"`
	WhitelistSourceRange []string
	Compress             bool              `export:"true"`
	ProxyProtocol        *ProxyProtocol    `export:"true"`
	ForwardedHeaders     *ForwardedHeaders `export:"true"`
}

EntryPoint holds an entry point configuration of the reverse proxy (ip, port, TLS...)

type EntryPoints

type EntryPoints map[string]*EntryPoint

EntryPoints holds entry points configuration of the reverse proxy (ip, port, TLS...)

func (*EntryPoints) Get

func (ep *EntryPoints) Get() interface{}

Get return the EntryPoints map

func (*EntryPoints) Set

func (ep *EntryPoints) 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 (*EntryPoints) SetValue

func (ep *EntryPoints) SetValue(val interface{})

SetValue sets the EntryPoints map with val

func (*EntryPoints) String

func (ep *EntryPoints) 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.

func (*EntryPoints) Type

func (ep *EntryPoints) Type() string

Type is type of the struct

type ForwardedHeaders

type ForwardedHeaders struct {
	Insecure   bool
	TrustedIPs []string
}

ForwardedHeaders Trust client forwarding headers

type ForwardingTimeouts

type ForwardingTimeouts struct {
	DialTimeout           flaeg.Duration `` /* 164-byte string literal not displayed */
	ResponseHeaderTimeout flaeg.Duration `` /* 175-byte string literal not displayed */
}

ForwardingTimeouts contains timeout configurations for forwarding requests to the backend servers.

type GlobalConfiguration

type GlobalConfiguration struct {
	LifeCycle                 *LifeCycle         `description:"Timeouts influencing the server life cycle" export:"true"`
	GraceTimeOut              flaeg.Duration     `short:"g" description:"(Deprecated) Duration to give active requests a chance to finish before Traefik stops" export:"true"` // Deprecated
	Debug                     bool               `short:"d" description:"Enable debug mode" export:"true"`
	CheckNewVersion           bool               `description:"Periodically check if a new version has been released" export:"true"`
	SendAnonymousUsage        bool               `description:"send periodically anonymous usage statistics" export:"true"`
	AccessLogsFile            string             `description:"(Deprecated) Access logs file" export:"true"` // Deprecated
	AccessLog                 *types.AccessLog   `description:"Access log settings" export:"true"`
	TraefikLogsFile           string             `description:"(Deprecated) Traefik logs file. Stdout is used when omitted or empty" export:"true"` // Deprecated
	TraefikLog                *types.TraefikLog  `description:"Traefik log settings" export:"true"`
	LogLevel                  string             `short:"l" description:"Log level" export:"true"`
	EntryPoints               EntryPoints        `` /* 245-byte string literal not displayed */
	Cluster                   *types.Cluster     `description:"Enable clustering" export:"true"`
	Constraints               types.Constraints  `description:"Filter services by constraint, matching with service tags" export:"true"`
	ACME                      *acme.ACME         `description:"Enable ACME (Let's Encrypt): automatic SSL" export:"true"`
	DefaultEntryPoints        DefaultEntryPoints `description:"Entrypoints to be used by frontends that do not specify any entrypoint" export:"true"`
	ProvidersThrottleDuration flaeg.Duration     `` /* 227-byte string literal not displayed */
	MaxIdleConnsPerHost       int                `` /* 142-byte string literal not displayed */
	IdleTimeout               flaeg.Duration     `` // Deprecated
	/* 135-byte string literal not displayed */
	InsecureSkipVerify bool                    `description:"Disable SSL certificate verification" export:"true"`
	RootCAs            tls.RootCAs             `description:"Add cert file for self-signed certificate"`
	Retry              *Retry                  `description:"Enable retry sending request if network error" export:"true"`
	HealthCheck        *HealthCheckConfig      `description:"Health check parameters" export:"true"`
	RespondingTimeouts *RespondingTimeouts     `description:"Timeouts for incoming requests to the Traefik instance" export:"true"`
	ForwardingTimeouts *ForwardingTimeouts     `description:"Timeouts for requests forwarded to the backend servers" export:"true"`
	Web                *WebCompatibility       `description:"(Deprecated) Enable Web backend with default settings" export:"true"` // Deprecated
	Docker             *docker.Provider        `description:"Enable Docker backend with default settings" export:"true"`
	File               *file.Provider          `description:"Enable File backend with default settings" export:"true"`
	Marathon           *marathon.Provider      `description:"Enable Marathon backend with default settings" export:"true"`
	Consul             *consul.Provider        `description:"Enable Consul backend with default settings" export:"true"`
	ConsulCatalog      *consul.CatalogProvider `description:"Enable Consul catalog backend with default settings" export:"true"`
	Etcd               *etcd.Provider          `description:"Enable Etcd backend with default settings" export:"true"`
	Zookeeper          *zk.Provider            `description:"Enable Zookeeper backend with default settings" export:"true"`
	Boltdb             *boltdb.Provider        `description:"Enable Boltdb backend with default settings" export:"true"`
	Kubernetes         *kubernetes.Provider    `description:"Enable Kubernetes backend with default settings" export:"true"`
	Mesos              *mesos.Provider         `description:"Enable Mesos backend with default settings" export:"true"`
	Eureka             *eureka.Provider        `description:"Enable Eureka backend with default settings" export:"true"`
	ECS                *ecs.Provider           `description:"Enable ECS backend with default settings" export:"true"`
	Rancher            *rancher.Provider       `description:"Enable Rancher backend with default settings" export:"true"`
	DynamoDB           *dynamodb.Provider      `description:"Enable DynamoDB backend with default settings" export:"true"`
	ServiceFabric      *servicefabric.Provider `description:"Enable Service Fabric backend with default settings" export:"true"`
	Rest               *rest.Provider          `description:"Enable Rest backend with default settings" export:"true"`
	API                *api.Handler            `description:"Enable api/dashboard" export:"true"`
	Metrics            *types.Metrics          `description:"Enable a metrics exporter" export:"true"`
	Ping               *ping.Handler           `description:"Enable ping" export:"true"`
}

GlobalConfiguration holds global configuration (with providers, etc.). It's populated from the traefik configuration file passed as an argument to the binary.

func (*GlobalConfiguration) SetEffectiveConfiguration added in v1.4.1

func (gc *GlobalConfiguration) SetEffectiveConfiguration(configFile string)

SetEffectiveConfiguration adds missing configuration parameters derived from existing ones. It also takes care of maintaining backwards compatibility.

func (*GlobalConfiguration) ValidateConfiguration added in v1.5.1

func (gc *GlobalConfiguration) ValidateConfiguration()

ValidateConfiguration validate that configuration is coherent

type HealthCheckConfig

type HealthCheckConfig struct {
	Interval flaeg.Duration `description:"Default periodicity of enabled health checks" export:"true"`
}

HealthCheckConfig contains health check configuration parameters.

type LifeCycle added in v1.5.0

type LifeCycle struct {
	RequestAcceptGraceTimeout flaeg.Duration `description:"Duration to keep accepting requests before Traefik initiates the graceful shutdown procedure"`
	GraceTimeOut              flaeg.Duration `description:"Duration to give active requests a chance to finish before Traefik stops"`
}

LifeCycle contains configurations relevant to the lifecycle (such as the shutdown phase) of Traefik.

type ProxyProtocol

type ProxyProtocol struct {
	Insecure   bool
	TrustedIPs []string
}

ProxyProtocol contains Proxy-Protocol configuration

type RespondingTimeouts

type RespondingTimeouts struct {
	ReadTimeout  flaeg.Duration `` /* 142-byte string literal not displayed */
	WriteTimeout flaeg.Duration `` /* 133-byte string literal not displayed */
	IdleTimeout  flaeg.Duration `` /* 194-byte string literal not displayed */
}

RespondingTimeouts contains timeout configurations for incoming requests to the Traefik instance.

type Retry

type Retry struct {
	Attempts int `description:"Number of attempts" export:"true"`
}

Retry contains request retry config

type WebCompatibility added in v1.5.0

type WebCompatibility struct {
	Address    string            `description:"Web administration port" export:"true"`
	CertFile   string            `description:"SSL certificate" export:"true"`
	KeyFile    string            `description:"SSL certificate" export:"true"`
	ReadOnly   bool              `description:"Enable read only API" export:"true"`
	Statistics *types.Statistics `description:"Enable more detailed statistics" export:"true"`
	Metrics    *types.Metrics    `description:"Enable a metrics exporter" export:"true"`
	Path       string            `description:"Root path for dashboard and API" export:"true"`
	Auth       *types.Auth       `export:"true"`
	Debug      bool              `export:"true"`
}

WebCompatibility is a configuration to handle compatibility with deprecated web provider options

Jump to

Keyboard shortcuts

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