Files

32 lines
646 B
Go
Raw Permalink Normal View History

2026-03-15 09:27:24 +08:00
package kernel
import (
"strings"
2026-11-27 11:41:30 +08:00
"github.com/viaeon/way-node/internal/model"
2026-03-15 09:27:24 +08:00
)
// NeedsGeoIP returns true when any panel route rule contains a "geoip:" match entry.
2026-04-11 05:36:59 +08:00
func NeedsGeoIP(routes []model.RouteRule) bool {
2026-03-15 09:27:24 +08:00
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.
2026-04-11 05:36:59 +08:00
func NeedsGeoSite(routes []model.RouteRule) bool {
2026-03-15 09:27:24 +08:00
for _, r := range routes {
for _, m := range r.Match {
if strings.HasPrefix(m, "geosite:") {
return true
}
}
}
return false
}