qqwry

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package qqwry is a qqwry.dat reader, fork from https://github.com/tonywubo/qqwry TODO: refactor and release as a package

Index

Constants

View Source
const (
	// KeyURL is url to download key
	KeyURL = "http://update.cz88.net/ip/copywrite.rar"

	// DbURL is url to download db
	DbURL = "http://update.cz88.net/ip/qqwry.rar"
)

Variables

This section is empty.

Functions

func Download

func Download(key uint32) (int64, io.ReadCloser, error)

Download create a io.ReadCloser from db url with provided key

func GetDownloadKey

func GetDownloadKey() (uint32, error)

GetDownloadKey reads newest key from key url

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is qqwry db reader

func Open

func Open(file string) (*Reader, error)

Open qqwry db

func (*Reader) Query

func (r *Reader) Query(ip net.IP) (*Record, error)

Query ip geo info

type Record

type Record struct {
	Country string
	City    string
}

Record is query result

func (*Record) String

func (record *Record) String() string

Jump to

Keyboard shortcuts

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