server

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2017 License: MIT Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHealthCheckInterval = 30 * time.Second

DefaultHealthCheckInterval is the default health check interval.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	CertFile string
	KeyFile  string
}

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
	Redirect *Redirect
	Auth     *types.Auth
	Compress bool
}

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 GlobalConfiguration

type GlobalConfiguration struct {
	GraceTimeOut              flaeg.Duration          `short:"g" description:"Duration to give active requests a chance to finish during hot-reload"`
	Debug                     bool                    `short:"d" description:"Enable debug mode"`
	CheckNewVersion           bool                    `description:"Periodically check if a new version has been released"`
	AccessLogsFile            string                  `description:"Access logs file"`
	TraefikLogsFile           string                  `description:"Traefik logs file"`
	LogLevel                  string                  `short:"l" description:"Log level"`
	EntryPoints               EntryPoints             `` /* 231-byte string literal not displayed */
	Cluster                   *types.Cluster          `description:"Enable clustering"`
	Constraints               types.Constraints       `description:"Filter services by constraint, matching with service tags"`
	ACME                      *acme.ACME              `description:"Enable ACME (Let's Encrypt): automatic SSL"`
	DefaultEntryPoints        DefaultEntryPoints      `description:"Entrypoints to be used by frontends that do not specify any entrypoint"`
	ProvidersThrottleDuration flaeg.Duration          `` /* 213-byte string literal not displayed */
	MaxIdleConnsPerHost       int                     `` /* 128-byte string literal not displayed */
	IdleTimeout               flaeg.Duration          `description:"maximum amount of time an idle (keep-alive) connection will remain idle before closing itself."`
	InsecureSkipVerify        bool                    `description:"Disable SSL certificate verification"`
	Retry                     *Retry                  `description:"Enable retry sending request if network error"`
	HealthCheck               *HealthCheckConfig      `description:"Health check parameters"`
	Docker                    *docker.Provider        `description:"Enable Docker backend"`
	File                      *file.Provider          `description:"Enable File backend"`
	Web                       *WebProvider            `description:"Enable Web backend"`
	Marathon                  *marathon.Provider      `description:"Enable Marathon backend"`
	Consul                    *consul.Provider        `description:"Enable Consul backend"`
	ConsulCatalog             *consul.CatalogProvider `description:"Enable Consul catalog backend"`
	Etcd                      *etcd.Provider          `description:"Enable Etcd backend"`
	Zookeeper                 *zk.Provider            `description:"Enable Zookeeper backend"`
	Boltdb                    *boltdb.Provider        `description:"Enable Boltdb backend"`
	Kubernetes                *kubernetes.Provider    `description:"Enable Kubernetes backend"`
	Mesos                     *mesos.Provider         `description:"Enable Mesos backend"`
	Eureka                    *eureka.Provider        `description:"Enable Eureka backend"`
	ECS                       *ecs.Provider           `description:"Enable ECS backend"`
	Rancher                   *rancher.Provider       `description:"Enable Rancher backend"`
	DynamoDB                  *dynamodb.Provider      `description:"Enable DynamoDB backend"`
}

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

type HealthCheckConfig

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

HealthCheckConfig contains health check configuration parameters.

type OxyLogger

type OxyLogger struct {
}

OxyLogger implements oxy Logger interface with logrus.

func (*OxyLogger) Errorf

func (oxylogger *OxyLogger) Errorf(format string, args ...interface{})

Errorf logs specified string as Warningf level in logrus.

func (*OxyLogger) Infof

func (oxylogger *OxyLogger) Infof(format string, args ...interface{})

Infof logs specified string as Debug level in logrus.

func (*OxyLogger) Warningf

func (oxylogger *OxyLogger) Warningf(format string, args ...interface{})

Warningf logs specified string as Warning level in logrus.

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 Retry

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

Retry contains request retry config

type Rules

type Rules struct {
	// contains filtered or unexported fields
}

Rules holds rule parsing and configuration

func (*Rules) Parse

func (r *Rules) Parse(expression string) (*mux.Route, error)

Parse parses rules expressions

func (*Rules) ParseDomains

func (r *Rules) ParseDomains(expression string) ([]string, error)

ParseDomains parses rules expressions and returns domains

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the reverse-proxy/load-balancer engine

func NewServer

func NewServer(globalConfiguration GlobalConfiguration) *Server

NewServer returns an initialized Server.

func (*Server) Close

func (server *Server) Close()

Close destroys the server

func (*Server) Start

func (server *Server) Start()

Start starts the server.

func (*Server) Stop

func (server *Server) Stop()

Stop stops the server

func (*Server) Wait

func (server *Server) Wait()

Wait blocks until server is shutted down.

type TLS

type TLS struct {
	MinVersion    string
	CipherSuites  []string
	Certificates  Certificates
	ClientCAFiles []string
}

TLS configures TLS for an entry point

type TraefikConfiguration

type TraefikConfiguration struct {
	GlobalConfiguration `mapstructure:",squash"`
	ConfigFile          string `short:"c" description:"Configuration file to use (TOML)."`
}

TraefikConfiguration holds GlobalConfiguration and other stuff

func NewTraefikConfiguration

func NewTraefikConfiguration() *TraefikConfiguration

NewTraefikConfiguration creates a TraefikConfiguration with default values

func NewTraefikDefaultPointersConfiguration

func NewTraefikDefaultPointersConfiguration() *TraefikConfiguration

NewTraefikDefaultPointersConfiguration creates a TraefikConfiguration with pointers default values

type WebProvider

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

	Auth *types.Auth
	// contains filtered or unexported fields
}

WebProvider is a provider.Provider implementation that provides the UI. FIXME to be handled another way.

func (*WebProvider) Provide

func (provider *WebProvider) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, _ types.Constraints) error

Provide allows the provider to provide configurations to traefik using the given configuration channel.

Jump to

Keyboard shortcuts

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