Skip to content

chore: Add comments to indicate what each field on a network node means #4241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions tailnet/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,25 @@ import (

// Node represents a node in the network.
type Node struct {
ID tailcfg.NodeID `json:"id"`
Key key.NodePublic `json:"key"`
DiscoKey key.DiscoPublic `json:"disco"`
PreferredDERP int `json:"preferred_derp"`
DERPLatency map[string]float64 `json:"derp_latency"`
Addresses []netip.Prefix `json:"addresses"`
AllowedIPs []netip.Prefix `json:"allowed_ips"`
Endpoints []string `json:"endpoints"`
// ID is used to identify the connection.
ID tailcfg.NodeID `json:"id"`
// Key is the Wireguard public key of the node.
Key key.NodePublic `json:"key"`
// DiscoKey is used for discovery messages over DERP to establish peer-to-peer connections.
DiscoKey key.DiscoPublic `json:"disco"`
// PreferredDERP is the DERP server that peered connections
// should meet at to establish.
PreferredDERP int `json:"preferred_derp"`
// DERPLatency is the latency in seconds to each DERP server.
DERPLatency map[string]float64 `json:"derp_latency"`
// Addresses are the IP address ranges this connection exposes.
Addresses []netip.Prefix `json:"addresses"`
// AllowedIPs specify what addresses can dial the connection.
// We allow all by default.
AllowedIPs []netip.Prefix `json:"allowed_ips"`
// Endpoints are ip:port combinations that can be used to establish
// peer-to-peer connections.
Endpoints []string `json:"endpoints"`
}

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