From d3620c5863f126113af99ad3ea005ccfd1b824af Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Thu, 21 Jan 2021 11:54:01 +0800 Subject: [PATCH] =?UTF-8?q?docs(=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3):=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 3de48f1..a083971 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,33 @@ # qqwry[![Go Reference](https://pkg.go.dev/badge/github.com/xiaoqidun/qqwry.svg)](https://pkg.go.dev/github.com/xiaoqidun/qqwry) + golang qqwry,内存操作,线程安全,支持缓存的纯真IP查询库 +# 使用说明 + +```go +package main + +import ( + "github.com/xiaoqidun/qqwry" + "log" +) + +func main() { + // 从文件加载IP数据库 + if err := qqwry.LoadFile("qqwry.dat"); err != nil { + panic(err) + } + // 从内存或缓存查询IP + country, area, err := qqwry.QueryIP("1.1.1.1") + log.Printf("国家:%s,区域:%s,错误:%v", country, area, err) +} +``` + # 特别感谢 + - 感谢[纯真IP库](https://www.cz88.net/)一直坚持为大家提供免费IP数据库 - 感谢[yinheli](https://github.com/yinheli)的[qqwry](https://github.com/yinheli/qqwry)项目,为我提供纯真ip库解析算法参考 # 授权说明 + 使用本类库你唯一需要做的就是把LICENSE文件往你用到的项目中拷贝一份。 \ No newline at end of file