forked from SW/traefik
rework loadbalancer support
This commit is contained in:
committed by
Traefiker Bot
parent
b143101f82
commit
518a37e776
@@ -120,7 +120,7 @@ func WithRule(rule string) func(*config.Router) {
|
||||
func WithServers(opts ...func(*config.Server)) func(*config.LoadBalancerService) {
|
||||
return func(b *config.LoadBalancerService) {
|
||||
for _, opt := range opts {
|
||||
server := config.Server{Weight: 1}
|
||||
server := config.Server{}
|
||||
opt(&server)
|
||||
b.Servers = append(b.Servers, server)
|
||||
}
|
||||
@@ -137,13 +137,6 @@ func WithServer(url string, opts ...func(*config.Server)) func(*config.Server) {
|
||||
}
|
||||
}
|
||||
|
||||
// WithLBMethod is a helper to create a configuration.
|
||||
func WithLBMethod(method string) func(*config.LoadBalancerService) {
|
||||
return func(b *config.LoadBalancerService) {
|
||||
b.Method = method
|
||||
}
|
||||
}
|
||||
|
||||
// WithStickiness is a helper to create a configuration.
|
||||
func WithStickiness(cookieName string) func(*config.LoadBalancerService) {
|
||||
return func(b *config.LoadBalancerService) {
|
||||
|
||||
Reference in New Issue
Block a user