provider

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2017 License: MIT Imports: 67 Imported by: 0

Documentation

Overview

Package provider holds the different provider implementation.

Index

Constants

View Source
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"
)
View Source
const (
	// 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
)
View Source
const (
	// DockerAPIVersion is a constant holding the version of the Docker API traefik will use
	DockerAPIVersion string = "1.21"
)
View Source
const (
	// RancherDefaultWatchTime is the duration of the interval when polling rancher
	RancherDefaultWatchTime = 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

func (provider *BoltDb) CreateStore() (store.Store, error)

CreateStore creates the KV store

func (*BoltDb) Provide

func (provider *BoltDb) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints types.Constraints) 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

func (*ClientTLS) CreateTLSConfig added in v1.1.0

func (clientTLS *ClientTLS) CreateTLSConfig() (*tls.Config, error)

CreateTLSConfig creates a TLS config from ClientTLS structures

type Consul

type Consul struct {
	Kv `mapstructure:",squash"`
}

Consul holds configurations of the Consul provider.

func (*Consul) CreateStore added in v1.1.0

func (provider *Consul) CreateStore() (store.Store, error)

CreateStore creates the KV store

func (*Consul) Provide

func (provider *Consul) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints types.Constraints) 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.Constraints) 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.Constraints) error

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

type ECS added in v1.2.0

type ECS struct {
	BaseProvider `mapstructure:",squash"`

	Domain           string `description:"Default domain used"`
	ExposedByDefault bool   `description:"Expose containers by default"`
	RefreshSeconds   int    `description:"Polling interval (in seconds)"`

	// ECS lookup parameters
	Cluster         string `description:"ECS Cluster Name"`
	Region          string `description:"The AWS region to use for requests"`
	AccessKeyID     string `description:"The AWS credentials access key to use for making requests"`
	SecretAccessKey string `description:"The AWS credentials access key to use for making requests"`
}

ECS holds configurations of the ECS provider.

func (*ECS) Provide added in v1.2.0

func (provider *ECS) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints types.Constraints) 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

func (provider *Etcd) CreateStore() (store.Store, error)

CreateStore creates the KV store

func (*Etcd) Provide

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

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

type Eureka added in v1.2.0

type Eureka struct {
	BaseProvider `mapstructure:",squash"`
	Endpoint     string
	Delay        string
}

Eureka holds configuration of the Eureka provider.

func (*Eureka) Provide added in v1.2.0

func (provider *Eureka) 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.

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, constraints types.Constraints) 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             k8s.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.Constraints) 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"`
	DialerTimeout           time.Duration `description:"Set a non-default connection timeout for Marathon"`
	KeepAlive               time.Duration `description:"Set a non-default TCP Keep Alive time in seconds"`
	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.Constraints) error

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

type MarathonBasic

type MarathonBasic struct {
	HTTPBasicAuthUser string
	HTTPBasicPassword string
}

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.Constraints) error

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

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.Constraints) error
}

Provider defines methods of a provider.

type Rancher added in v1.2.0

type Rancher struct {
	BaseProvider     `mapstructure:",squash"`
	Endpoint         string `description:"Rancher server HTTP(S) endpoint."`
	AccessKey        string `description:"Rancher server access key."`
	SecretKey        string `description:"Rancher server Secret Key."`
	ExposedByDefault bool   `description:"Expose Services by default"`
	Domain           string `description:"Default domain used"`
}

Rancher holds configurations of the Rancher provider.

func (*Rancher) Provide added in v1.2.0

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

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

type Zookepper

type Zookepper struct {
	Kv `mapstructure:",squash"`
}

Zookepper holds configurations of the Zookepper provider.

func (*Zookepper) CreateStore added in v1.1.0

func (provider *Zookepper) CreateStore() (store.Store, error)

CreateStore creates the KV store

func (*Zookepper) Provide

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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