types/views: add ContainsExitRoutes to IPPrefixSlice

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali 2022-03-04 09:05:25 -08:00 committed by Brad Fitzpatrick
parent b493ef5b71
commit c85694fac4

View File

@ -101,6 +101,11 @@ func (v IPPrefixSlice) ContainsFunc(f func(netaddr.IPPrefix) bool) bool {
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.
func (v IPPrefixSlice) MarshalJSON() ([]byte, error) {
return json.Marshal(v.ж)