MCPcopy Create free account
hub / github.com/PostHog/duckgres / getLocalIPs

Function getLocalIPs

cmd/cache-proxy/peers.go:214–226  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

212 port := pm.peerPort
213 if len(port) > 0 && port[0] == ':' {
214 port = port[1:]
215 }
216
217 var peers []string
218 seen := make(map[string]struct{}, len(ips))
219 for _, ip := range ips {
220 if mySet[ip] {
221 continue // skip self
222 }
223 peer := net.JoinHostPort(ip, port)
224 if _, exists := seen[peer]; exists {
225 continue
226 }
227 seen[peer] = struct{}{}
228 peers = append(peers, peer)
229 }

Callers 1

resolveMethod · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected