Files
EdgeCommon/pkg/serverconfigs/ip_library.go
2020-11-04 15:51:38 +08:00

24 lines
493 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
}