mihomo/component/mmdb/patch.go

17 lines
372 B
Go
Raw Normal View History

2023-10-23 16:50:43 +08:00
package mmdb
2023-08-07 14:38:23 +08:00
import "github.com/oschwald/maxminddb-golang"
2023-10-23 16:50:43 +08:00
2023-08-06 21:54:28 +08:00
func InstallOverride(override *maxminddb.Reader) {
newReader := Reader{Reader: override}
switch override.Metadata.DatabaseType {
case "sing-geoip":
reader.databaseType = typeSing
case "Meta-geoip0":
reader.databaseType = typeMetaV0
default:
reader.databaseType = typeMaxmind
}
reader = newReader
2023-10-23 16:50:43 +08:00
}