mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 13:18:53 +00:00
tailcfg: add Node.HasCap helpers
This makes a follow up change less noisy. Updates #cleanup Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -368,6 +368,16 @@ type Node struct {
|
||||
ExitNodeDNSResolvers []*dnstype.Resolver `json:",omitempty"`
|
||||
}
|
||||
|
||||
// HasCap reports whether the node has the given capability.
|
||||
func (v NodeView) HasCap(cap NodeCapability) bool {
|
||||
return v.ж.HasCap(cap)
|
||||
}
|
||||
|
||||
// HasCap reports whether the node has the given capability.
|
||||
func (v *Node) HasCap(cap NodeCapability) bool {
|
||||
return v != nil && slices.Contains(v.Capabilities, cap)
|
||||
}
|
||||
|
||||
// DisplayName returns the user-facing name for a node which should
|
||||
// be shown in client UIs.
|
||||
//
|
||||
|
Reference in New Issue
Block a user