Turn configureBackends into method.
This commit is contained in:
parent
2c45428c8a
commit
f9839f7b1d
2 changed files with 4 additions and 3 deletions
|
@ -255,7 +255,7 @@ func (server *Server) defaultConfigurationValues(configuration *types.Configurat
|
|||
return
|
||||
}
|
||||
server.configureFrontends(configuration.Frontends)
|
||||
configureBackends(configuration.Backends)
|
||||
server.configureBackends(configuration.Backends)
|
||||
}
|
||||
|
||||
func (server *Server) listenConfigurations(stop chan bool) {
|
||||
|
@ -889,7 +889,7 @@ func (server *Server) configureFrontends(frontends map[string]*types.Frontend) {
|
|||
}
|
||||
}
|
||||
|
||||
func configureBackends(backends map[string]*types.Backend) {
|
||||
func (*Server) configureBackends(backends map[string]*types.Backend) {
|
||||
for backendName, backend := range backends {
|
||||
_, err := types.NewLoadBalancerMethod(backend.LoadBalancer)
|
||||
if err != nil {
|
||||
|
|
|
@ -341,7 +341,8 @@ func TestConfigureBackends(t *testing.T) {
|
|||
LoadBalancer: test.lb,
|
||||
}
|
||||
|
||||
configureBackends(map[string]*types.Backend{
|
||||
srv := Server{}
|
||||
srv.configureBackends(map[string]*types.Backend{
|
||||
"backend": backend,
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue