Partial default values
This commit is contained in:
parent
95557a8dba
commit
388a7f6ab5
3 changed files with 27 additions and 0 deletions
|
@ -18,6 +18,15 @@ type DockerProvider struct {
|
||||||
Domain string
|
Domain string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewDockerProvider() *DockerProvider {
|
||||||
|
dockerProvider := new(DockerProvider)
|
||||||
|
// default
|
||||||
|
dockerProvider.Watch = true
|
||||||
|
dockerProvider.Domain = "traefik"
|
||||||
|
|
||||||
|
return dockerProvider
|
||||||
|
}
|
||||||
|
|
||||||
var DockerFuncMap = template.FuncMap{
|
var DockerFuncMap = template.FuncMap{
|
||||||
"getBackend": func(container docker.Container) string {
|
"getBackend": func(container docker.Container) string {
|
||||||
for key, value := range container.Config.Labels {
|
for key, value := range container.Config.Labels {
|
||||||
|
|
8
file.go
8
file.go
|
@ -13,6 +13,14 @@ type FileProvider struct {
|
||||||
Filename string
|
Filename string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewFileProvider() *FileProvider {
|
||||||
|
fileProvider := new(FileProvider)
|
||||||
|
// default values
|
||||||
|
fileProvider.Watch = true
|
||||||
|
|
||||||
|
return fileProvider
|
||||||
|
}
|
||||||
|
|
||||||
func (provider *FileProvider) Provide(configurationChan chan<- *Configuration){
|
func (provider *FileProvider) Provide(configurationChan chan<- *Configuration){
|
||||||
watcher, err := fsnotify.NewWatcher()
|
watcher, err := fsnotify.NewWatcher()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
10
marathon.go
10
marathon.go
|
@ -19,6 +19,16 @@ type MarathonProvider struct {
|
||||||
NetworkInterface string
|
NetworkInterface string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewMarathonProvider() *MarathonProvider {
|
||||||
|
marathonProvider := new(MarathonProvider)
|
||||||
|
// default values
|
||||||
|
marathonProvider.Watch = true
|
||||||
|
marathonProvider.Domain = "traefik"
|
||||||
|
marathonProvider.NetworkInterface = "eth0"
|
||||||
|
|
||||||
|
return marathonProvider
|
||||||
|
}
|
||||||
|
|
||||||
var MarathonFuncMap = template.FuncMap{
|
var MarathonFuncMap = template.FuncMap{
|
||||||
"getPort": func(task marathon.Task) string {
|
"getPort": func(task marathon.Task) string {
|
||||||
for _, port := range task.Ports {
|
for _, port := range task.Ports {
|
||||||
|
|
Loading…
Reference in a new issue