MCPcopy Index your code
hub / github.com/coder/coder / nodeAddresses

Method nodeAddresses

tailnet/configmaps.go:627–636  ·  view source on GitHub ↗

nodeAddresses returns the addresses for the peer with the given publicKey, if known.

(publicKey key.NodePublic)

Source from the content-addressed store, hash-verified

625
626// nodeAddresses returns the addresses for the peer with the given publicKey, if known.
627func (c *configMaps) nodeAddresses(publicKey key.NodePublic) ([]netip.Prefix, bool) {
628 c.L.Lock()
629 defer c.L.Unlock()
630 for _, lc := range c.peers {
631 if lc.node != nil && lc.node.Key == publicKey {
632 return lc.node.Addresses, true
633 }
634 }
635 return nil, false
636}
637
638func (c *configMaps) fillPeerDiagnostics(d *PeerDiagnostics, peerID uuid.UUID) {
639 status := c.status()

Callers 1

NodeAddressesMethod · 0.80

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected