qqwry

package module
v0.0.0-...-8ac1102 Latest Latest
Warning

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

Go to latest
Published: May 5, 2019 License: MIT Imports: 6 Imported by: 1

README

qqwry

纯真ip数据库查询

本代码改自原自己的Delphi版本

by:ying32 2016/5/13

未测试多种带有重定义或未重定义的IP,如果查询出错,可发邮件给我,告知改进,或者由您改进,但记得发我一份。

纯真网络 纯真IP数据格式

golang使用例程
import (
	"fmt"
	"github.com/ying32/qqwry"
)

func main() {
	qdat := qqwry.NewQQWry("qqwry.dat")
	fmt.Println("version=", qdat.Version())
	fmt.Println(qdat.GetIPLocation(2005104178))
	fmt.Println(qdat.GetIPLocationOfString("119.131.118.50"))
}

Documentation

Index

Constants

View Source
const (
	REDIRECT_MODE_1 = 1
	REDIRECT_MODE_2 = 2
)

重定义模式

Variables

This section is empty.

Functions

This section is empty.

Types

type QQWry

type QQWry struct {
	RecordCount uint32
	FirstRecord uint32
}

func NewQQWry

func NewQQWry(fileName string) *QQWry

模拟构造函数

func (*QQWry) GetIPLocation

func (self *QQWry) GetIPLocation(ip uint32) string

读取指定ip字符串位置

func (*QQWry) GetIPLocationOfString

func (self *QQWry) GetIPLocationOfString(ipstr string) string

查找字符串ip

func (*QQWry) IPToStr

func (self *QQWry) IPToStr(ip uint32) string

整型转ip字符,ipv4

func (*QQWry) StrToIP

func (self *QQWry) StrToIP(ipstr string) uint32

字符串ip转整型

func (*QQWry) Version

func (self *QQWry) Version() string

获取版本信息

Jump to

Keyboard shortcuts

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