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 return nil
} }
} else { } else {
buf, err := Asset("providerTemplates/docker.tmpl") buf, err := Asset("templates/docker.tmpl")
if err != nil { if err != nil {
log.Error("Error reading file", err) 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.weight=10`: assign this weight to the application
- `traefik.enable=false`: disable this application in Træfɪk - `traefik.enable=false`: disable this application in Træfɪk
- `traefik.host=bar`: override the default routing from `{appName}.{domain}` to `bar.{domain}` - `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 * `traefik.domain=traefik.localhost`: override the default domain
## <a id="consul"></a> Consul backend ## <a id="consul"></a> Consul backend

View file

@ -4,6 +4,6 @@ Copyright
//go:generate go get github.com/jteeuwen/go-bindata/... //go:generate go get github.com/jteeuwen/go-bindata/...
//go:generate rm -vf gen.go //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 package main

2
kv.go
View file

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

View file

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

View file

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

7
web.go
View file

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