Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultGeoIPRepoTag = "202308170052"
View Source
const GEOIPFileMainName = "Country.mmdb"
View Source
const GeoIPGitRepoUrl = "https://github.com/Loyalsoldier/geoip"
View Source
const ProxiedUrlPrefix = ""
View Source
const RepoName = "geoip"
View Source
const RepoOwner = "Loyalsoldier"
Variables ¶
View Source
var GeoIPDBUrlTemplate = "%shttps://github.com/Loyalsoldier/geoip/releases/download/%s/Country.mmdb"
Functions ¶
This section is empty.
Types ¶
type GeoIPClient ¶
type GeoIPClient struct { *GeoIPGitRepo GeoIPDb *geoip2.Reader }
var GlobalGeoIPClient GeoIPClient
func (GeoIPClient) GetIPISOCode ¶
func (c GeoIPClient) GetIPISOCode(ipStr string) string
type GeoIPGitRepo ¶
type GeoIPGitRepo struct { GeoIPDbFileName string `json:"geoIpDbFileName"` GEOIPFileMainName string `json:"geoipFileMainMame"` LatestTagName string `json:"LatestTagName"` CurrentTagName string `json:"currentTagName"` }
func (*GeoIPGitRepo) DownloadLatestGEOIPDb ¶
func (repo *GeoIPGitRepo) DownloadLatestGEOIPDb(latestTag string) (dbName string, err error)
func (*GeoIPGitRepo) GetCurrentGeoIPDbFileInfo ¶
func (repo *GeoIPGitRepo) GetCurrentGeoIPDbFileInfo()
GetCurrentGeoIPDbFileInfo
@Description: 获取当前目录的Country.mmdb 信息 @receiver repo
func (*GeoIPGitRepo) GetRepoLatestTag ¶
func (repo *GeoIPGitRepo) GetRepoLatestTag() Release
GetRepoLatestTag
@Description: 获取最新的geoip tag @receiver repo @return Release
func (*GeoIPGitRepo) KeepLatestMmdb ¶ added in v1.0.8
func (repo *GeoIPGitRepo) KeepLatestMmdb()
Click to show internal directories.
Click to hide internal directories.