Git Product home page Git Product logo

qqwry's Introduction

QQWry Go Reference

Golang QQWry,高性能纯真IP查询库。

使用须知

  1. 仅支持ipv4查询。
  2. city也可能是国家。

使用说明

package main

import (
	"github.com/xiaoqidun/qqwry"
	"log"
)

func main() {
	// 从文件加载IP数据库
	if err := qqwry.LoadFile("qqwry.dat"); err != nil {
		panic(err)
	}
	// 从内存或缓存查询IP
	city, isp, err := qqwry.QueryIP("1.1.1.1")
	log.Printf("城市:%s,运营商:%s,错误:%v", city, isp, err)
}

IP数据库

编译说明

  1. 下载IP数据库并放置于assets目录中。
  2. client和server需要go1.16的内嵌资源特性。
  3. 作为库使用,请直接引包,并不需要go1.16+才能编译。

服务接口

  1. 自行根据需要调整server下源码。
  2. 可以通过-listen参数指定http服务地址。
  3. json api:curl http://127.0.0.1/ip/1.1.1.1

特别感谢

  • 感谢纯真IP库一直坚持为大家提供免费IP数据库。
  • 感谢yinheliqqwry项目,为我提供纯真ip库解析算法参考。

授权说明

使用本类库你唯一需要做的就是把LICENSE文件往你用到的项目中拷贝一份。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.