mirror of https://github.com/coder/coder.git
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>
This commit is contained in:
parent
518f6960d0
commit
6c83012082
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue