Fix backend reuse

This commit is contained in:
Arne Jørgensen 2018-06-06 17:56:03 +02:00 committed by Traefiker Bot
parent 9cf4e730e7
commit 51227241b7
4 changed files with 94 additions and 8 deletions

View file

@ -137,6 +137,13 @@ func WithRoute(name string, rule string) func(*types.Route) string {
}
}
// WithBasicAuth is a helper to create a configuration
func WithBasicAuth(username string, password string) func(*types.Frontend) {
return func(fe *types.Frontend) {
fe.BasicAuth = []string{username + ":" + password}
}
}
// WithLBSticky is a helper to create a configuration
func WithLBSticky(cookieName string) func(*types.Backend) {
return func(b *types.Backend) {