README ¶ geoip GEO IP resolve utils build and import to database build and export to sqlite db file Expand ▾ Collapse ▴ Documentation ¶ Index ¶ Constants func IP2Uint(ip string) uint32 func Uint2IP(ip uint32) string type GeoData type GeoIP func NewGeoIP(strDatFile string) (*GeoIP, error) func (g *GeoIP) Find(ip string) *GeoLocation type GeoLocation Constants ¶ View Source const ( CZNET = "纯真网络" CZ88 = "CZ88.NET" ) Variables ¶ This section is empty. Functions ¶ func IP2Uint ¶ func IP2Uint(ip string) uint32 func Uint2IP ¶ func Uint2IP(ip uint32) string Types ¶ type GeoData ¶ type GeoData struct { IPBegin string `json:"ip_begin"` IPBeginUint32 uint32 `json:"ip_begin_uint32"` IPEnd string `json:"ip_end"` IPEndUint32 uint32 `json:"ip_end_uint32"` Country string `json:"country"` Province string `json:"province"` City string `json:"city"` Area string `json:"area"` } type GeoIP ¶ type GeoIP struct { // contains filtered or unexported fields } func NewGeoIP ¶ func NewGeoIP(strDatFile string) (*GeoIP, error) func (*GeoIP) Find ¶ func (g *GeoIP) Find(ip string) *GeoLocation type GeoLocation ¶ type GeoLocation struct { IP string `json:"ip"` Country string `json:"country"` Province string `json:"province"` City string `json:"city"` Area string `json:"area"` } Source Files ¶ View all Source files geoip.goutils.go Directories ¶ Show internal Expand all Path Synopsis cmd Click to show internal directories. Click to hide internal directories.