Feature: add mode script

This commit is contained in:
yaling888
2021-10-15 14:11:14 +08:00
parent 862174d21b
commit c0e9d69163
28 changed files with 1918 additions and 356 deletions

View File

@@ -52,12 +52,12 @@ func NewGEOSITE(country string, adapter string, ruleExtra *C.RuleExtra) (*GEOSIT
//geoLoaderName := "memconservative"
geoLoader, err := geodata.GetGeoDataLoader(geoLoaderName)
if err != nil {
return nil, fmt.Errorf("[GeoSite] %s", err.Error())
return nil, fmt.Errorf("load GeoSite data error, %s", err.Error())
}
domains, err := geoLoader.LoadGeoSite(country)
if err != nil {
return nil, fmt.Errorf("[GeoSite] %s", err.Error())
return nil, fmt.Errorf("load GeoSite data error, %s", err.Error())
}
//linear: linear algorithm
@@ -66,7 +66,7 @@ func NewGEOSITE(country string, adapter string, ruleExtra *C.RuleExtra) (*GEOSIT
//mphminimal perfect hash algorithm
matcher, err := router.NewMphMatcherGroup(domains)
if err != nil {
return nil, fmt.Errorf("[GeoSite] %s", err.Error())
return nil, fmt.Errorf("load GeoSite data error, %s", err.Error())
}
log.Infoln("Start initial GeoSite rule %s => %s, records: %d", country, adapter, len(domains))