Files
2026-04-11 05:39:59 +08:00

32 lines
652 B
Go

package kernel
import (
"strings"
"github.com/cedar2025/xboard-node/internal/model"
)
// NeedsGeoIP returns true when any panel route rule contains a "geoip:" match entry.
func NeedsGeoIP(routes []model.RouteRule) bool {
for _, r := range routes {
for _, m := range r.Match {
if strings.HasPrefix(m, "geoip:") {
return true
}
}
}
return false
}
// NeedsGeoSite returns true when any panel route rule contains a "geosite:" match entry.
func NeedsGeoSite(routes []model.RouteRule) bool {
for _, r := range routes {
for _, m := range r.Match {
if strings.HasPrefix(m, "geosite:") {
return true
}
}
}
return false
}