1
0
Fork 0

Flaeg integration

This commit is contained in:
Martin 2016-05-03 16:52:14 +02:00
parent 7804787e9e
commit fe0a8f3363
16 changed files with 361 additions and 401 deletions

View file

@ -9,7 +9,7 @@ import (
// BoltDb holds configurations of the BoltDb provider.
type BoltDb struct {
Kv `mapstructure:",squash"`
Kv `mapstructure:",squash" description:"go through"`
}
// Provide allows the provider to provide configurations to traefik

View file

@ -9,7 +9,7 @@ import (
// Consul holds configurations of the Consul provider.
type Consul struct {
Kv `mapstructure:",squash"`
Kv `mapstructure:",squash" description:"go through"`
}
// Provide allows the provider to provide configurations to traefik

View file

@ -24,8 +24,8 @@ const (
// ConsulCatalog holds configurations of the Consul catalog provider.
type ConsulCatalog struct {
BaseProvider `mapstructure:",squash"`
Endpoint string
Domain string
Endpoint string `description:"Consul server endpoint"`
Domain string `description:"Default domain used"`
client *api.Client
Prefix string
}

View file

@ -30,17 +30,17 @@ const DockerAPIVersion string = "1.21"
// Docker holds configurations of the Docker provider.
type Docker struct {
BaseProvider `mapstructure:",squash"`
Endpoint string
Domain string
TLS *DockerTLS
Endpoint string `description:"Docker server endpoint. Can be a tcp or a unix socket endpoint"`
Domain string `description:"Default domain used"`
TLS *DockerTLS `description:"Enable Docker TLS support"`
}
// DockerTLS holds TLS specific configurations
type DockerTLS struct {
CA string
Cert string
Key string
InsecureSkipVerify bool
CA string `description:"TLS CA"`
Cert string `description:"TLS cert"`
Key string `description:"TLS key"`
InsecureSkipVerify bool `description:"TLS insecure skip verify"`
}
func (provider *Docker) createClient() (client.APIClient, error) {

View file

@ -9,7 +9,7 @@ import (
// Etcd holds configurations of the Etcd provider.
type Etcd struct {
Kv `mapstructure:",squash"`
Kv `mapstructure:",squash" description:"go through"`
}
// Provide allows the provider to provide configurations to traefik

View file

@ -14,7 +14,7 @@ import (
// File holds configurations of the File provider.
type File struct {
BaseProvider `mapstructure:",squash"`
BaseProvider `mapstructure:",squash" description:"go through"`
}
// Provide allows the provider to provide configurations to traefik

View file

@ -20,12 +20,15 @@ const (
serviceAccountCACert = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
)
// Namespaces holds kubernetes namespaces
type Namespaces []string
// Kubernetes holds configurations of the Kubernetes provider.
type Kubernetes struct {
BaseProvider `mapstructure:",squash"`
Endpoint string
disablePassHostHeaders bool
Namespaces []string
Endpoint string `description:"Kubernetes server endpoint"`
DisablePassHostHeaders bool `description:"Kubernetes disable PassHost Headers"`
Namespaces Namespaces `description:"Kubernetes namespaces"`
}
func (provider *Kubernetes) createClient() (k8s.Client, error) {
@ -259,7 +262,7 @@ func equalPorts(servicePort k8s.ServicePort, ingressPort k8s.IntOrString) bool {
}
func (provider *Kubernetes) getPassHostHeader() bool {
if provider.disablePassHostHeaders {
if provider.DisablePassHostHeaders {
return false
}
return true

View file

@ -22,20 +22,20 @@ import (
// Kv holds common configurations of key-value providers.
type Kv struct {
BaseProvider `mapstructure:",squash"`
Endpoint string
Prefix string
TLS *KvTLS
BaseProvider `mapstructure:",squash" description:"go through"`
Endpoint string `description:"Comma sepparated server endpoints"`
Prefix string `description:"Prefix used for KV store"`
TLS *KvTLS `description:"Enable TLS support"`
storeType store.Backend
kvclient store.Store
}
// KvTLS holds TLS specific configurations
type KvTLS struct {
CA string
Cert string
Key string
InsecureSkipVerify bool
CA string `description:"TLS CA"`
Cert string `description:"TLS cert"`
Key string `description:"TLS key"`
InsecureSkipVerify bool `description:"TLS insecure skip verify"`
}
func (provider *Kv) watchKv(configurationChan chan<- types.ConfigMessage, prefix string, stop chan bool) error {

View file

@ -20,10 +20,10 @@ import (
// Marathon holds configuration of the Marathon provider.
type Marathon struct {
BaseProvider `mapstructure:",squash"`
Endpoint string
Domain string
ExposedByDefault bool
BaseProvider `mapstructure:",squash" description:"go through"`
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"`
Basic *MarathonBasic
TLS *tls.Config
marathonClient marathon.Marathon
@ -36,8 +36,8 @@ type MarathonBasic struct {
}
type lightMarathonClient interface {
Applications(url.Values) (*marathon.Applications, error)
AllTasks(v url.Values) (*marathon.Tasks, error)
Applications(url.Values) (*marathon.Applications, error)
}
// Provide allows the provider to provide configurations to traefik

View file

@ -22,8 +22,8 @@ type Provider interface {
// BaseProvider should be inherited by providers
type BaseProvider struct {
Watch bool
Filename string
Watch bool `description:"Watch provider"`
Filename string `description:"Override default configuration template. For advanced users :)"`
}
func (p *BaseProvider) getConfiguration(defaultTemplateFile string, funcMap template.FuncMap, templateObjects interface{}) (*types.Configuration, error) {

View file

@ -9,7 +9,7 @@ import (
// Zookepper holds configurations of the Zookepper provider.
type Zookepper struct {
Kv
Kv `description:"go through"`
}
// Provide allows the provider to provide configurations to traefik