Documentation ¶
Overview ¶
Package provider holds the different provider implementation.
Index ¶
Constants ¶
const ( // DefaultWatchWaitTime is the duration to wait when polling consul DefaultWatchWaitTime = 15 * time.Second // DefaultConsulCatalogTagPrefix is a prefix for additional service/node configurations DefaultConsulCatalogTagPrefix = "traefik" )
const ( // DockerAPIVersion is a constant holding the version of the Docker API traefik will use DockerAPIVersion string = "1.21" // SwarmAPIVersion is a constant holding the version of the Docker API traefik will use SwarmAPIVersion string = "1.24" // SwarmDefaultWatchTime is the duration of the interval when polling docker SwarmDefaultWatchTime = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func Ignore ¶ added in v1.1.0
func Ignore(f ErrorFunction)
Ignore Calls an ErrorFunction, and ignores the result. This allows us to be more explicit when there is no error handling to be done, for example in defers
Types ¶
type BaseProvider ¶
type BaseProvider struct { Watch bool `description:"Watch provider"` Filename string `description:"Override default configuration template. For advanced users :)"` Constraints types.Constraints `description:"Filter services by constraint, matching with Traefik tags."` }
BaseProvider should be inherited by providers
func (*BaseProvider) MatchConstraints ¶
func (p *BaseProvider) MatchConstraints(tags []string) (bool, *types.Constraint)
MatchConstraints must match with EVERY single contraint returns first constraint that do not match or nil
type BoltDb ¶
type BoltDb struct {
Kv `mapstructure:",squash"`
}
BoltDb holds configurations of the BoltDb provider.
func (*BoltDb) CreateStore ¶ added in v1.1.0
CreateStore creates the KV store
func (*BoltDb) Provide ¶
func (provider *BoltDb) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints []types.Constraint) error
Provide allows the provider to provide configurations to traefik using the given configuration channel.
type ClientTLS ¶ added in v1.1.0
type ClientTLS struct { CA string `description:"TLS CA"` Cert string `description:"TLS cert"` Key string `description:"TLS key"` InsecureSkipVerify bool `description:"TLS insecure skip verify"` }
ClientTLS holds TLS specific configurations as client CA, Cert and Key can be either path or file contents
type Consul ¶
type Consul struct {
Kv `mapstructure:",squash"`
}
Consul holds configurations of the Consul provider.
func (*Consul) CreateStore ¶ added in v1.1.0
CreateStore creates the KV store
func (*Consul) Provide ¶
func (provider *Consul) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints []types.Constraint) error
Provide allows the provider to provide configurations to traefik using the given configuration channel.
type ConsulCatalog ¶
type ConsulCatalog struct { BaseProvider `mapstructure:",squash"` Endpoint string `description:"Consul server endpoint"` Domain string `description:"Default domain used"` Prefix string // contains filtered or unexported fields }
ConsulCatalog holds configurations of the Consul catalog provider.
func (*ConsulCatalog) Provide ¶
func (provider *ConsulCatalog) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints []types.Constraint) error
Provide allows the provider to provide configurations to traefik using the given configuration channel.
type Docker ¶
type Docker struct { BaseProvider `mapstructure:",squash"` Endpoint string `description:"Docker server endpoint. Can be a tcp or a unix socket endpoint"` Domain string `description:"Default domain used"` TLS *ClientTLS `description:"Enable Docker TLS support"` ExposedByDefault bool `description:"Expose containers by default"` UseBindPortIP bool `description:"Use the ip address from the bound port, rather than from the inner network"` SwarmMode bool `description:"Use Docker on Swarm Mode"` }
Docker holds configurations of the Docker provider.
func (*Docker) Provide ¶
func (provider *Docker) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints []types.Constraint) error
Provide allows the provider to provide configurations to traefik using the given configuration channel.
type ErrorFunction ¶ added in v1.1.0
type ErrorFunction func() error
ErrorFunction A function definition that returns an error to be passed to the Ignore or Panic error handler
type Etcd ¶
type Etcd struct {
Kv `mapstructure:",squash"`
}
Etcd holds configurations of the Etcd provider.
func (*Etcd) CreateStore ¶ added in v1.1.0
CreateStore creates the KV store
func (*Etcd) Provide ¶
func (provider *Etcd) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints []types.Constraint) error
Provide allows the provider to provide configurations to traefik using the given configuration channel.
type File ¶
type File struct {
BaseProvider `mapstructure:",squash"`
}
File holds configurations of the File provider.
func (*File) Provide ¶
func (provider *File) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, _ []types.Constraint) error
Provide allows the provider to provide configurations to traefik using the given configuration channel.
type Kubernetes ¶
type Kubernetes struct { BaseProvider `mapstructure:",squash"` Endpoint string `description:"Kubernetes server endpoint"` DisablePassHostHeaders bool `description:"Kubernetes disable PassHost Headers"` Namespaces Namespaces `description:"Kubernetes namespaces"` LabelSelector string `description:"Kubernetes api label selector to use"` // contains filtered or unexported fields }
Kubernetes holds configurations of the Kubernetes provider.
func (*Kubernetes) Provide ¶
func (provider *Kubernetes) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints []types.Constraint) error
Provide allows the provider to provide configurations to traefik using the given configuration channel.
type Kv ¶
type Kv struct { BaseProvider `mapstructure:",squash"` Endpoint string `description:"Comma sepparated server endpoints"` Prefix string `description:"Prefix used for KV store"` TLS *ClientTLS `description:"Enable TLS support"` // contains filtered or unexported fields }
Kv holds common configurations of key-value providers.
type Marathon ¶
type Marathon struct { BaseProvider Endpoint string `description:"Marathon server endpoint. You can also specify multiple endpoint for Marathon"` Domain string `description:"Default domain used"` ExposedByDefault bool `description:"Expose Marathon apps by default"` GroupsAsSubDomains bool `description:"Convert Marathon groups to subdomains"` DCOSToken string `description:"DCOSToken for DCOS environment, This will override the Authorization header"` MarathonLBCompatibility bool `description:"Add compatibility with marathon-lb labels"` TLS *ClientTLS `description:"Enable Docker TLS support"` Basic *MarathonBasic // contains filtered or unexported fields }
Marathon holds configuration of the Marathon provider.
func (*Marathon) Provide ¶
func (provider *Marathon) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints []types.Constraint) error
Provide allows the provider to provide configurations to traefik using the given configuration channel.
type MarathonBasic ¶
MarathonBasic holds basic authentication specific configurations
type Mesos ¶ added in v1.1.0
type Mesos struct { BaseProvider Endpoint string `description:"Mesos server endpoint. You can also specify multiple endpoint for Mesos"` Domain string `description:"Default domain used"` ExposedByDefault bool `description:"Expose Mesos apps by default"` GroupsAsSubDomains bool `description:"Convert Mesos groups to subdomains"` ZkDetectionTimeout int `description:"Zookeeper timeout (in seconds)"` RefreshSeconds int `description:"Polling interval (in seconds)"` IPSources string `description:"IPSources (e.g. host, docker, mesos, rkt)"` // e.g. "host", "docker", "mesos", "rkt" StateTimeoutSecond int `description:"HTTP Timeout (in seconds)"` Masters []string }
Mesos holds configuration of the mesos provider.
func (*Mesos) Provide ¶ added in v1.1.0
func (provider *Mesos) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints []types.Constraint) error
Provide allows the provider to provide configurations to traefik using the given configuration channel.
type Namespaces ¶
type Namespaces []string
Namespaces holds kubernetes namespaces
func (*Namespaces) Set ¶
func (ns *Namespaces) Set(str string) error
Set adds strings elem into the the parser it splits str on , and ;
func (*Namespaces) SetValue ¶
func (ns *Namespaces) SetValue(val interface{})
SetValue sets []string into the parser
type Provider ¶
type Provider interface { // Provide allows the provider to provide configurations to traefik // using the given configuration channel. Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints []types.Constraint) error }
Provider defines methods of a provider.
type Zookepper ¶
type Zookepper struct {
Kv `mapstructure:",squash"`
}
Zookepper holds configurations of the Zookepper provider.
func (*Zookepper) CreateStore ¶ added in v1.1.0
CreateStore creates the KV store
func (*Zookepper) Provide ¶
func (provider *Zookepper) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints []types.Constraint) error
Provide allows the provider to provide configurations to traefik using the given configuration channel.