qqwry

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldCountry = "country"
	FieldArea    = "area"
)
View Source
const (
	DBFormat = "qqwry"
	DBExt    = ".dat"
)

Variables

View Source
var CommonFieldsAlias = map[string]string{
	model.Country: FieldCountry,
	model.ISP:     FieldArea,
}

CommonFieldsAlias 公共字段到数据库字段映射

View Source
var FullFields = []string{
	FieldCountry,
	FieldArea,
}

FullFields 全字段列表

Functions

This section is empty.

Types

type Reader

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

Reader is a structure that provides functionalities to read from QQWry IP database.

func NewReader

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

NewReader initializes a new instance of Reader.

func (*Reader) Close

func (r *Reader) Close() error

Close closes the IP database.

func (*Reader) Find

func (r *Reader) Find(ip net.IP) (*model.IPInfo, error)

Find retrieves IP information based on the given IP address.

func (*Reader) Meta

func (r *Reader) Meta() *model.Meta

Meta returns the meta-information of the IP database.

func (*Reader) SetOption

func (r *Reader) SetOption(option interface{}) error

SetOption configures the Reader with the provided option.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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