From 9c64e015e5a66e3d25a7d1f2d6f1789d31ae0ad1 Mon Sep 17 00:00:00 2001 From: Charlotte Brandhorst-Satzkorn Date: Tue, 27 Jun 2023 11:00:10 -0700 Subject: [PATCH] tailcfg: update location docs This change updates the documentation for the fields on the location struct. Updates tailscale/corp#12146 Signed-off-by: Charlotte Brandhorst-Satzkorn --- tailcfg/tailcfg.go | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index d344e2bd4..71b04cad7 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -535,15 +535,22 @@ type Service struct { // Tailscale host. Location is optional and only set if // explicitly declared by a node. type Location struct { - Country string `json:",omitempty"` // User friendly country name, with proper capitalization, e.g "Canada" - CountryCode string `json:",omitempty"` // ISO 3166-1 alpha-2 in lower case, e.g "ca" - City string `json:",omitempty"` // User friendly city name, with proper capitalization, e.g. "Squamish" - CityCode string `json:",omitempty"` - - // Priority determines the priority an exit node is given when the - // location data between two or more nodes is tied. - // A higher value indicates that the exit node is more preferable - // for use. + Country string `json:",omitempty"` // User friendly country name, with proper capitalization ("Canada") + CountryCode string `json:",omitempty"` // ISO 3166-1 alpha-2 in upper case ("CA") + City string `json:",omitempty"` // User friendly city name, with proper capitalization ("Squamish") + + // CityCode is a short code representing the city in upper case. + // CityCode is used to disambiguate a city from another location + // with the same city name. It uniquely identifies a particular + // geographical location, within the tailnet. + // IATA, ICAO or ISO 3166-2 codes are recommended ("YSE") + CityCode string `json:",omitempty"` + + // Priority determines the order of use of an exit node when a + // location based preference matches more than one exit node, + // the node with the highest priority wins. Nodes of equal + // probability may be selected arbitrarily. + // // A value of 0 means the exit node does not have a priority // preference. A negative int is not allowed. Priority int `json:",omitempty"`