MCPcopy
hub / github.com/grafana/dskit / GetInstanceAddr

Function GetInstanceAddr

ring/util.go:18–29  ·  view source on GitHub ↗

GetInstanceAddr returns the address to use to register the instance in the ring.

(configAddr string, netInterfaces []string, logger log.Logger, enableInet6 bool)

Source from the content-addressed store, hash-verified

16// GetInstanceAddr returns the address to use to register the instance
17// in the ring.
18func 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.

Calls 1

GetFirstAddressOfFunction · 0.92