2015-11-01 16:35:01 +01:00
|
|
|
package provider
|
|
|
|
|
2015-11-13 11:50:32 +01:00
|
|
|
import (
|
|
|
|
"github.com/docker/libkv/store"
|
|
|
|
"github.com/docker/libkv/store/consul"
|
|
|
|
"github.com/emilevauge/traefik/types"
|
|
|
|
)
|
2015-09-21 18:05:56 +02:00
|
|
|
|
2015-11-01 19:29:47 +01:00
|
|
|
// Consul holds configurations of the Consul provider.
|
2015-11-02 19:48:34 +01:00
|
|
|
type Consul struct {
|
2015-11-13 11:50:32 +01:00
|
|
|
Kv
|
2015-09-21 18:05:56 +02:00
|
|
|
}
|
|
|
|
|
2015-11-01 19:29:47 +01:00
|
|
|
// Provide allows the provider to provide configurations to traefik
|
|
|
|
// using the given configuration channel.
|
2015-11-02 19:48:34 +01:00
|
|
|
func (provider *Consul) Provide(configurationChan chan<- types.ConfigMessage) error {
|
2015-11-13 11:50:32 +01:00
|
|
|
provider.StoreType = store.CONSUL
|
|
|
|
consul.Register()
|
|
|
|
return provider.provide(configurationChan)
|
2015-09-21 18:05:56 +02:00
|
|
|
}
|