Turn configureBackends into method.

This commit is contained in:
Timo Reimann 2017-05-15 23:53:35 +02:00
parent 2c45428c8a
commit f9839f7b1d
2 changed files with 4 additions and 3 deletions

View file

@ -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 {

View file

@ -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,
})