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

Method fillPeerDiagnostics

tailnet/configmaps.go:638–658  ·  view source on GitHub ↗
(d *PeerDiagnostics, peerID uuid.UUID)

Source from the content-addressed store, hash-verified

636}
637
638func (c *configMaps) fillPeerDiagnostics(d *PeerDiagnostics, peerID uuid.UUID) {
639 status := c.status()
640 c.L.Lock()
641 defer c.L.Unlock()
642 if c.derpMap != nil {
643 for j, r := range c.derpMap.Regions {
644 d.DERPRegionNames[j] = r.RegionName
645 }
646 }
647 lc, ok := c.peers[peerID]
648 if !ok || lc.node == nil {
649 return
650 }
651
652 d.ReceivedNode = lc.node
653 ps, ok := status.Peer[lc.node.Key]
654 if !ok {
655 return
656 }
657 d.LastWireguardHandshake = ps.LastHandshake
658}
659
660func (c *configMaps) knownPeerIDs() []uuid.UUID {
661 c.L.Lock()

Callers

nothing calls this directly

Calls 3

statusMethod · 0.95
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected