GetInstanceAddr returns the address to use to register the instance in the ring.
(configAddr string, netInterfaces []string, logger log.Logger, enableInet6 bool)
| 16 | // GetInstanceAddr returns the address to use to register the instance |
| 17 | // in the ring. |
| 18 | func GetInstanceAddr(configAddr string, netInterfaces []string, logger log.Logger, enableInet6 bool) (string, error) { |
| 19 | if configAddr != "" { |
| 20 | return configAddr, nil |
| 21 | } |
| 22 | |
| 23 | addr, err := netutil.GetFirstAddressOf(netInterfaces, logger, enableInet6) |
| 24 | if err != nil { |
| 25 | return "", err |
| 26 | } |
| 27 | |
| 28 | return addr, nil |
| 29 | } |
| 30 | |
| 31 | // GetInstancePort returns the port to use to register the instance |
| 32 | // in the ring. |