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

Method protoNodeToTailcfg

tailnet/configmaps.go:608–624  ·  view source on GitHub ↗
(p *proto.Node)

Source from the content-addressed store, hash-verified

606}
607
608func (c *configMaps) protoNodeToTailcfg(p *proto.Node) (*tailcfg.Node, error) {
609 node, err := ProtoToNode(p)
610 if err != nil {
611 return nil, err
612 }
613 return &tailcfg.Node{
614 ID: tailcfg.NodeID(p.GetId()),
615 Created: c.clock.Now(),
616 Key: node.Key,
617 DiscoKey: node.DiscoKey,
618 Addresses: node.Addresses,
619 AllowedIPs: node.AllowedIPs,
620 Endpoints: node.Endpoints,
621 DERP: fmt.Sprintf("%s:%d", tailcfg.DerpMagicIP, node.PreferredDERP),
622 Hostinfo: (&tailcfg.Hostinfo{}).View(),
623 }, nil
624}
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) {

Calls 3

ProtoToNodeFunction · 0.85
GetIdMethod · 0.45
ViewMethod · 0.45