Help us shape the future of Go! Take the 2026 Go Developer Survey

configuration

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2017 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 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
)

Variables

View Source
var CipherSuites = map[string]uint16{
	`TLS_RSA_WITH_RC4_128_SHA`:                tls.TLS_RSA_WITH_RC4_128_SHA,
	`TLS_RSA_WITH_3DES_EDE_CBC_SHA`:           tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
	`TLS_RSA_WITH_AES_128_CBC_SHA`:            tls.TLS_RSA_WITH_AES_128_CBC_SHA,
	`TLS_RSA_WITH_AES_256_CBC_SHA`:            tls.TLS_RSA_WITH_AES_256_CBC_SHA,
	`TLS_RSA_WITH_AES_128_CBC_SHA256`:         tls.TLS_RSA_WITH_AES_128_CBC_SHA256,
	`TLS_RSA_WITH_AES_128_GCM_SHA256`:         tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
	`TLS_RSA_WITH_AES_256_GCM_SHA384`:         tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
	`TLS_ECDHE_ECDSA_WITH_RC4_128_SHA`:        tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
	`TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA`:    tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
	`TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA`:    tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
	`TLS_ECDHE_RSA_WITH_RC4_128_SHA`:          tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
	`TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA`:     tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
	`TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA`:      tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
	`TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA`:      tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
	`TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256`: tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
	`TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256`:   tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
	`TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256`:   tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
	`TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256`: tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
	`TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384`:   tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
	`TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384`: tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
	`TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305`:    tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
	`TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305`:  tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
}

CipherSuites Map of TLS CipherSuites from crypto/tls Available CipherSuites defined at https://golang.org/pkg/crypto/tls/#pkg-constants

View Source
var MinVersion = map[string]uint16{
	`VersionTLS10`: tls.VersionTLS10,
	`VersionTLS11`: tls.VersionTLS11,
	`VersionTLS12`: tls.VersionTLS12,
}

MinVersion Map of allowed TLS minimum versions

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	CertFile FileOrContent
	KeyFile  FileOrContent
}

Certificate holds a SSL cert/key pair Certs and Key could be either a file path, or the file content itself

type Certificates

type Certificates []Certificate

Certificates defines traefik certificates type Certs and Keys could be either a file path, or the file content itself

func (*Certificates) CreateTLSConfig

func (certs *Certificates) CreateTLSConfig() (*tls.Config, error)

CreateTLSConfig creates a TLS config from Certificate structures

func (*Certificates) Set

func (certs *Certificates) 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 (*Certificates) String

func (certs *Certificates) 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 (*Certificates) Type

func (certs *Certificates) Type() string

Type is type of the struct

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        `export:"true"`
	Redirect             *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 FileOrContent

type FileOrContent string

FileOrContent hold a file path or content

func (FileOrContent) Read

func (f FileOrContent) Read() ([]byte, error)

func (FileOrContent) String

func (f FileOrContent) String() string

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 {
	GraceTimeOut              flaeg.Duration     `short:"g" description:"Duration to give active requests a chance to finish before Traefik stops" export:"true"`
	Debug                     bool               `short:"d" description:"Enable debug mode" export:"true"`
	CheckNewVersion           bool               `description:"Periodically check if a new version has been released" export:"true"`
	AccessLogsFile            string             `description:"(Deprecated) Access logs file" export:"true"` // Deprecated
	AccessLog                 *types.AccessLog   `description:"Access log settings" export:"true"`
	TraefikLogsFile           string             `description:"Traefik logs file. Stdout is used when omitted or empty" 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            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"`
	Docker             *docker.Provider        `description:"Enable Docker backend with default settings" export:"true"`
	File               *file.Provider          `description:"Enable File backend with default settings" export:"true"`
	Web                *web.Provider           `description:"Enable Web 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"`
}

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()

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

type HealthCheckConfig

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

HealthCheckConfig contains health check configuration parameters.

type ProxyProtocol

type ProxyProtocol struct {
	Insecure   bool
	TrustedIPs []string
}

ProxyProtocol contains Proxy-Protocol configuration

type Redirect

type Redirect struct {
	EntryPoint  string
	Regex       string
	Replacement string
}

Redirect configures a redirection of an entry point to another, or to an URL

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 RootCAs

type RootCAs []FileOrContent

RootCAs hold the CA we want to have in root

func (*RootCAs) Get

func (r *RootCAs) Get() interface{}

Get return the EntryPoints map

func (*RootCAs) Set

func (r *RootCAs) 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 (*RootCAs) SetValue

func (r *RootCAs) SetValue(val interface{})

SetValue sets the EntryPoints map with val

func (*RootCAs) String

func (r *RootCAs) 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 (*RootCAs) Type

func (r *RootCAs) Type() string

Type is type of the struct

type TLS

type TLS struct {
	MinVersion    string `export:"true"`
	CipherSuites  []string
	Certificates  Certificates
	ClientCAFiles []string
}

TLS configures TLS for an entry point

Jump to

Keyboard shortcuts

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