mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-09-19 20:15:59 +08:00
fix: api does not return configuration value
This commit is contained in:
@ -3,19 +3,37 @@ package geodata
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"golang.org/x/sync/singleflight"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/sync/singleflight"
|
||||
|
||||
"github.com/metacubex/mihomo/component/geodata/router"
|
||||
C "github.com/metacubex/mihomo/constant"
|
||||
"github.com/metacubex/mihomo/log"
|
||||
)
|
||||
|
||||
var geoLoaderName = "memconservative"
|
||||
var geoSiteMatcher = "succinct"
|
||||
var (
|
||||
geoMode bool
|
||||
AutoUpdate bool
|
||||
UpdateInterval int
|
||||
geoLoaderName = "memconservative"
|
||||
geoSiteMatcher = "succinct"
|
||||
)
|
||||
|
||||
// geoLoaderName = "standard"
|
||||
|
||||
func GeodataMode() bool {
|
||||
return geoMode
|
||||
}
|
||||
|
||||
func GeoAutoUpdate() bool {
|
||||
return AutoUpdate
|
||||
}
|
||||
|
||||
func GeoUpdateInterval() int {
|
||||
return UpdateInterval
|
||||
}
|
||||
|
||||
func LoaderName() string {
|
||||
return geoLoaderName
|
||||
}
|
||||
@ -24,6 +42,16 @@ func SiteMatcherName() string {
|
||||
return geoSiteMatcher
|
||||
}
|
||||
|
||||
func SetGeodataMode(newGeodataMode bool) {
|
||||
geoMode = newGeodataMode
|
||||
}
|
||||
func SetGeoAutoUpdate(newAutoUpdate bool) {
|
||||
AutoUpdate = newAutoUpdate
|
||||
}
|
||||
func SetGeoUpdateInterval(newGeoUpdateInterval int) {
|
||||
UpdateInterval = newGeoUpdateInterval
|
||||
}
|
||||
|
||||
func SetLoader(newLoader string) {
|
||||
if newLoader == "memc" {
|
||||
newLoader = "memconservative"
|
||||
|
Reference in New Issue
Block a user