Remove providerTemplates dir, moved in templates

This commit is contained in:
emile 2015-10-22 14:02:14 +02:00
parent 1fdff9dae4
commit 5dea2e7902
11 changed files with 12 additions and 11 deletions

View file

@ -162,7 +162,7 @@ func (provider *DockerProvider) loadDockerConfig(dockerClient *docker.Client) *C
return nil
}
} else {
buf, err := Asset("providerTemplates/docker.tmpl")
buf, err := Asset("templates/docker.tmpl")
if err != nil {
log.Error("Error reading file", err)
}

View file

@ -469,7 +469,7 @@ Labels can be used on containers to override default behaviour:
- `traefik.weight=10`: assign this weight to the application
- `traefik.enable=false`: disable this application in Træfɪk
- `traefik.host=bar`: override the default routing from `{appName}.{domain}` to `bar.{domain}`
- `traefik.prefixes=pf1,pf2`: use `PathPrefix(es)` instead of hostname for routing, use `filename="providerTemplates/marathon-prefix.tmpl"` with this option
- `traefik.prefixes=pf1,pf2`: use `PathPrefix(es)` instead of hostname for routing, use `filename="templates/marathon-prefix.tmpl"` with this option
* `traefik.domain=traefik.localhost`: override the default domain
## <a id="consul"></a> Consul backend

View file

@ -4,6 +4,6 @@ Copyright
//go:generate go get github.com/jteeuwen/go-bindata/...
//go:generate rm -vf gen.go
//go:generate go-bindata -o gen.go static/... templates/... providerTemplates/...
//go:generate go-bindata -o gen.go static/... templates/...
package main

2
kv.go
View file

@ -166,7 +166,7 @@ func (provider *KvProvider) loadConfig() *Configuration {
return nil
}
} else {
buf, err := Asset("providerTemplates/kv.tmpl")
buf, err := Asset("templates/kv.tmpl")
if err != nil {
log.Error("Error reading file", err)
}

View file

@ -167,7 +167,7 @@ func (provider *MarathonProvider) loadMarathonConfig() *Configuration {
return nil
}
} else {
buf, err := Asset("providerTemplates/marathon.tmpl")
buf, err := Asset("templates/marathon.tmpl")
if err != nil {
log.Error("Error reading file", err)
}

View file

@ -23,7 +23,6 @@ import (
"github.com/mailgun/oxy/forward"
"github.com/mailgun/oxy/roundrobin"
"github.com/thoas/stats"
"github.com/unrolled/render"
"gopkg.in/alecthomas/kingpin.v2"
"runtime"
)
@ -36,11 +35,6 @@ var (
currentConfigurations = make(configs)
metrics = stats.New()
oxyLogger = &OxyLogger{}
templatesRenderer = render.New(render.Options{
Directory: "templates",
Asset: Asset,
AssetNames: AssetNames,
})
)
func main() {

7
web.go
View file

@ -9,6 +9,7 @@ import (
log "github.com/Sirupsen/logrus"
"github.com/elazarl/go-bindata-assetfs"
"github.com/gorilla/mux"
"github.com/unrolled/render"
)
type WebProvider struct {
@ -16,6 +17,12 @@ type WebProvider struct {
CertFile, KeyFile string
}
var (
templatesRenderer = render.New(render.Options{
Directory: "nowhere",
})
)
func (provider *WebProvider) Provide(configurationChan chan<- configMessage) error {
systemRouter := mux.NewRouter()