Skip to content

Commit 6c83012

Browse files
kylecarbscoadler
andauthored
chore: Add comments to indicate what each field on a network node means (#4241)
* chore: Add comments to indicate what each field on a network node means * Update tailnet/coordinator.go Co-authored-by: Colin Adler <colin1adler@gmail.com> * Update tailnet/coordinator.go Co-authored-by: Colin Adler <colin1adler@gmail.com> * Update tailnet/coordinator.go Co-authored-by: Colin Adler <colin1adler@gmail.com> Co-authored-by: Colin Adler <colin1adler@gmail.com>
1 parent 518f696 commit 6c83012

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

tailnet/coordinator.go

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,25 @@ import (
1616

1717
// Node represents a node in the network.
1818
type Node struct {
19-
ID tailcfg.NodeID `json:"id"`
20-
Key key.NodePublic `json:"key"`
21-
DiscoKey key.DiscoPublic `json:"disco"`
22-
PreferredDERP int `json:"preferred_derp"`
23-
DERPLatency map[string]float64 `json:"derp_latency"`
24-
Addresses []netip.Prefix `json:"addresses"`
25-
AllowedIPs []netip.Prefix `json:"allowed_ips"`
26-
Endpoints []string `json:"endpoints"`
19+
// ID is used to identify the connection.
20+
ID tailcfg.NodeID `json:"id"`
21+
// Key is the Wireguard public key of the node.
22+
Key key.NodePublic `json:"key"`
23+
// DiscoKey is used for discovery messages over DERP to establish peer-to-peer connections.
24+
DiscoKey key.DiscoPublic `json:"disco"`
25+
// PreferredDERP is the DERP server that peered connections
26+
// should meet at to establish.
27+
PreferredDERP int `json:"preferred_derp"`
28+
// DERPLatency is the latency in seconds to each DERP server.
29+
DERPLatency map[string]float64 `json:"derp_latency"`
30+
// Addresses are the IP address ranges this connection exposes.
31+
Addresses []netip.Prefix `json:"addresses"`
32+
// AllowedIPs specify what addresses can dial the connection.
33+
// We allow all by default.
34+
AllowedIPs []netip.Prefix `json:"allowed_ips"`
35+
// Endpoints are ip:port combinations that can be used to establish
36+
// peer-to-peer connections.
37+
Endpoints []string `json:"endpoints"`
2738
}
2839

2940
// ServeCoordinator matches the RW structure of a coordinator to exchange node messages.

0 commit comments

Comments
 (0)