mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-12 13:48:01 +00:00
types/views: add generic Slice[T] and remove StringSlice
Also make IPPrefixSliceOf use Slice[netaddr.IPPrefix] as it also provides additional functions besides the standard ones provided by Slice[T]. Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -444,10 +444,10 @@ func (b *LocalBackend) populatePeerStatusLocked(sb *ipnstate.StatusBuilder) {
|
||||
exitNodeOption := tsaddr.PrefixesContainsFunc(p.AllowedIPs, func(r netaddr.IPPrefix) bool {
|
||||
return r.Bits() == 0
|
||||
})
|
||||
var tags *views.StringSlice
|
||||
var tags *views.Slice[string]
|
||||
var primaryRoutes *views.IPPrefixSlice
|
||||
if p.Tags != nil {
|
||||
v := views.StringSliceOf(p.Tags)
|
||||
v := views.SliceOf(p.Tags)
|
||||
tags = &v
|
||||
}
|
||||
if p.PrimaryRoutes != nil {
|
||||
|
@@ -112,7 +112,7 @@ type PeerStatus struct {
|
||||
|
||||
// Tags are the list of ACL tags applied to this node.
|
||||
// See tailscale.com/tailcfg#Node.Tags for more information.
|
||||
Tags *views.StringSlice `json:",omitempty"`
|
||||
Tags *views.Slice[string] `json:",omitempty"`
|
||||
|
||||
// PrimaryRoutes are the routes this node is currently the primary
|
||||
// subnet router for, as determined by the control plane. It does
|
||||
|
Reference in New Issue
Block a user