summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSimeng He <simeng@tailscale.com>2021-07-28 12:18:10 -0400
committerSimeng He <simeng@tailscale.com>2021-07-28 12:18:10 -0400
commit2ea24cd197e522d6eed9447ea44d38d68425d86d (patch)
treecf460cae22c9188822a4ba98807f9dbf70b97cf6
parent1b14e1d6bdca832c84bd01a7f17fb3a246c9176e (diff)
downloadtailscale-simenghe/pingresult-work.tar.xz
tailscale-simenghe/pingresult-work.zip
ipn/ipnstate: add json struct tags to PingResultsimenghe/pingresult-work
Signed-off-by: Simeng He <simeng@tailscale.com>
-rw-r--r--ipn/ipnstate/ipnstate.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/ipn/ipnstate/ipnstate.go b/ipn/ipnstate/ipnstate.go
index 52aa3f97a..f2245eed3 100644
--- a/ipn/ipnstate/ipnstate.go
+++ b/ipn/ipnstate/ipnstate.go
@@ -418,25 +418,25 @@ func osEmoji(os string) string {
// PingResult contains response information for the "tailscale ping" subcommand,
// saying how Tailscale can reach a Tailscale IP or subnet-routed IP.
type PingResult struct {
- IP string // ping destination
- NodeIP string // Tailscale IP of node handling IP (different for subnet routers)
- NodeName string // DNS name base or (possibly not unique) hostname
+ IP string `json:"ip"` // ping destination
+ NodeIP string `json:"nodeIP"` // Tailscale IP of node handling IP (different for subnet routers)
+ NodeName string `json:"nodeName"` // DNS name base or (possibly not unique) hostname
- Err string
- LatencySeconds float64
+ Err string `json:"err"`
+ LatencySeconds float64 `json:"latencySeconds"`
// Endpoint is the ip:port if direct UDP was used.
// It is not currently set for TSMP pings.
- Endpoint string
+ Endpoint string `json:"endpoint"`
// DERPRegionID is non-zero DERP region ID if DERP was used.
// It is not currently set for TSMP pings.
- DERPRegionID int
+ DERPRegionID int `json:"derpRegionID"`
// DERPRegionCode is the three-letter region code
// corresponding to DERPRegionID.
// It is not currently set for TSMP pings.
- DERPRegionCode string
+ DERPRegionCode string `json:"derpRegionCode"`
// PeerAPIPort is set by TSMP ping responses for peers that
// are running a peerapi server. This is the port they're