diff options
Diffstat (limited to 'types/netmap/netmap.go')
| -rw-r--r-- | types/netmap/netmap.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/types/netmap/netmap.go b/types/netmap/netmap.go index 233dcc656..e92a63278 100644 --- a/types/netmap/netmap.go +++ b/types/netmap/netmap.go @@ -68,6 +68,8 @@ type NetworkMap struct { // Domain is the current Tailnet name. Domain string + // DisplayName is the user editable version of the Domain. + DisplayName string `json:",omitempty"` // DomainAuditLogID is an audit log ID provided by control and // only populated if the domain opts into data-plane audit logging. @@ -187,6 +189,15 @@ func (nm *NetworkMap) DomainName() string { return nm.Domain } +// DisplayName returns the name of the NetworkMap's current tailnet user +// editable display name. If the map is nil, it returns an empty string. +func (nm *NetworkMap) GetDisplayName() string { + if nm == nil { + return "" + } + return nm.DisplayName +} + // SelfCapabilities returns SelfNode.Capabilities if nm and nm.SelfNode are // non-nil. This is a method so we can use it in envknob/logknob without a // circular dependency. |
