Accept a range of addresses

This commit is contained in:
Asim Aslam 2019-06-26 20:51:13 +01:00 committed by Vasiliy Tolstov
parent e21f065b7e
commit 30a0bfeeb8

View File

@ -59,14 +59,14 @@ func (g *grpcClient) next(request client.Request, opts client.CallOptions) (sele
// get proxy address // get proxy address
if prx := os.Getenv("MICRO_PROXY_ADDRESS"); len(prx) > 0 { if prx := os.Getenv("MICRO_PROXY_ADDRESS"); len(prx) > 0 {
opts.Address = prx opts.Address = []string{prx}
} }
// return remote address // return remote address
if len(opts.Address) > 0 { if len(opts.Address) > 0 {
return func() (*registry.Node, error) { return func() (*registry.Node, error) {
return &registry.Node{ return &registry.Node{
Address: opts.Address, Address: opts.Address[0],
}, nil }, nil
}, nil }, nil
} }