mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-04-26 16:35:20 +08:00
24 lines
493 B
Go
24 lines
493 B
Go
|
|
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
|
|||
|
|
}
|