WIP snapshot

Next up: view support for maps, etc.
This commit is contained in:
Josh Bleecher Snyder committed 2021-09-17 16:47:00 -07:00
1 parent b14db5d943
commit c7b7546587
15 files changed
+680 -60

No files matched your search

+4 -2
View File
@@ -5,6 +5,8 @@
// Package netmap contains the netmap.NetworkMap type.
package netmap
//go:generate go run tailscale.com/cmd/viewer --type=NetworkMap --output=netmap_view.go
import (
"encoding/json"
"fmt"
@@ -66,8 +68,8 @@ type NetworkMap struct {
// MagicDNS isn't necessarily in use).
//
// It will neither start nor end with a period.
func (nm *NetworkMap) MagicDNSSuffix() string {
name := strings.Trim(nm.Name, ".")
func (nm NetworkMapView) MagicDNSSuffix() string {
name := strings.Trim(nm.Name(), ".")
if i := strings.Index(name, "."); i != -1 {
name = name[i+1:]
}