GithubHelp home page GithubHelp logo

qqwry's Introduction

qqwry

纯真IP,golang 内存版

  • 2021-09-09
  • 初始化时优先加载本地磁盘数据,减少服务冷启动时间
  • 初始化完成后,无需等待定时更新任务,立刻更新一次在线数据
  • 每次更新在线数据库时,将新数据覆盖写入至本地磁盘

1.依赖

2.使用

  • 直接使用全局变量查询
package main

import (
    "qqwry"
    "fmt"
)

func main() {
    result, err := qqwry.Find("202.106.0.20")
    if err!=nil {
        panic(err)
    }
    fmt.Printf("%+v\n", result)
}
  • 初始化局部变量使用
package main

import (
    "qqwry"
    "fmt"
)

func main() {
    var result *qqway.Rq
    var err error
    var q *qqwry.QQwry
    if q, err = NewQQwry(); err != nil{
        panic(err)
    }
    
    result, err = q.Find("202.106.0.20")
    if err!=nil {
        panic(err)
    }
    fmt.Printf("%+v\n", result)
}

3.注意

线程安全,缓存操作。方便做服务器来查询。

每小时从官方地址获取新的纯真库文件(如果太频繁, 可能会被屏蔽掉), 如果发现不一致, 则进行更新。

qqwry's People

Contributors

lahcs avatar yinziyang avatar

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.