增加ip2region库管理

This commit is contained in:
GoEdgeLab
2020-11-04 15:51:38 +08:00
parent c987602235
commit 8ea33f7390
13 changed files with 2747 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package serverconfigs
import "github.com/iwind/TeaGo/maps"
// 所有的IP库类型
var IPLibraryTypes = []maps.Map{
{
"name": "ip2region",
"code": "ip2region",
"description": "一个开源的IP库https://github.com/lionsoul2014/ip2region",
"ext": ".db",
},
}
// 根据类型查找IP库
func FindIPLibraryWithType(libraryType string) maps.Map {
for _, t := range IPLibraryTypes {
if t.GetString("code") == libraryType {
return t
}
}
return nil
}