awdb

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FieldCountry 国家
	FieldCountry = "country"

	// FieldProvince 省份
	FieldProvince = "province"

	// FieldCity 城市
	FieldCity = "city"

	// FieldISP 运营商
	FieldISP = "isp"

	// FieldContinent 大洲
	FieldContinent = "continent"

	// FieldTimeZone 时区
	FieldTimeZone = "timezone"

	// FieldLatwgs WGS84坐标系纬度
	FieldLatwgs = "latwgs"

	// FieldLngwgs WGS84坐标系经度
	FieldLngwgs = "lngwgs"

	// FieldAdcode 行政区划代码
	FieldAdcode = "adcode"

	// FieldAccuracy 定位精度
	FieldAccuracy = "accuracy"

	// FieldAreaCode 国家编码
	FieldAreaCode = "areacode"

	// FieldASNumber 自治域编码
	FieldASNumber = "asnumber"

	// FieldOwner 所属机构
	FieldOwner = "owner"

	// FieldRadius 定位半径
	FieldRadius = "radius"

	// FieldSource 定位方式
	FieldSource = "source"

	// FieldZipCode 邮编
	FieldZipCode = "zipcode"
)
View Source
const (
	DBFormat = "awdb"
	DBExt    = ".awdb"
)

Variables

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

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 AWDB 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.

Jump to

Keyboard shortcuts

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