rework loadbalancer support
This commit is contained in:
parent
b143101f82
commit
518a37e776
86 changed files with 339 additions and 1055 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue