qqwry

package
v0.0.0-...-8296c84 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IndexLen 索引长度
	IndexLen = 7
	// RedirectMode1 国家的类型, 指向另一个指向
	RedirectMode1 = 0x01
	// RedirectMode2 国家的类型, 指向一个指向
	RedirectMode2 = 0x02
)

Variables

View Source
var IPData fileData

IPData IP库的数据

Functions

func FindIPs

func FindIPs(ips []string) (rs map[string]ResultQQwry)

func LoadData

func LoadData(datFile string)

Types

type QQwry

type QQwry struct {
	Data   *fileData
	Offset int64
}

QQwry 纯真ip库

func NewQQwry

func NewQQwry() QQwry

NewQQwry 新建 qqwry 类型

func (*QQwry) Find

func (q *QQwry) Find(ip string) (res ResultQQwry)

Find ip地址查询对应归属地信息

func (*QQwry) FindIPs

func (q *QQwry) FindIPs(ips []string) (rs map[string]ResultQQwry)

func (*QQwry) ReadData

func (q *QQwry) ReadData(num int, offset ...int64) (rs []byte)

ReadData 从文件中读取数据

func (*QQwry) SetOffset

func (q *QQwry) SetOffset(offset int64)

SetOffset 设置偏移量

type ResultQQwry

type ResultQQwry struct {
	IP      string `json:"ip"`
	Country string `json:"country"`
	Area    string `json:"area"`
}

ResultQQwry 归属地信息

func Find

func Find(ip string) (res ResultQQwry)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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