types/views: add ContainsExitRoutes to IPPrefixSlice

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/4074/head
Maisem Ali 3 years ago committed by Brad Fitzpatrick
parent b493ef5b71
commit c85694fac4

@ -101,6 +101,11 @@ func (v IPPrefixSlice) ContainsFunc(f func(netaddr.IPPrefix) bool) bool {
return tsaddr.PrefixesContainsFunc(v.ж, f) return tsaddr.PrefixesContainsFunc(v.ж, f)
} }
// ContainsExitRoutes reports whether v contains ExitNode Routes.
func (v IPPrefixSlice) ContainsExitRoutes() bool {
return tsaddr.ContainsExitRoutes(v.ж)
}
// MarshalJSON implements json.Marshaler. // MarshalJSON implements json.Marshaler.
func (v IPPrefixSlice) MarshalJSON() ([]byte, error) { func (v IPPrefixSlice) MarshalJSON() ([]byte, error) {
return json.Marshal(v.ж) return json.Marshal(v.ж)

Loading…
Cancel
Save