geoip

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

geoip

GEO IP resolve utils

build and import to database


build and export to sqlite db file


Documentation

Index

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址