db

package
v0.0.1-draft Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AWDBFieldCountry   = "country"
	AWDBFieldProvince  = "province"
	AWDBFieldCity      = "city"
	AWDBFieldISP       = "isp"
	AWDBFieldContinent = "continent"
	AWDBFieldTimeZone  = "timezone"
	AWDBFieldLatwgs    = "latwgs"
	AWDBFieldLngwgs    = "lngwgs"
	AWDBFieldAdcode    = "adcode"
	AWDBFieldAccuracy  = "accuracy"
	AWDBFieldAreaCode  = "areacode"
	AWDBFieldASNumber  = "asnumber"
	AWDBFieldOwner     = "owner"
	AWDBFieldRadius    = "radius"
	AWDBFieldSource    = "source"
	AWDBFieldZipCode   = "zipcode"
)

awdb 参数

View Source
const (
	IPDBFieldCountryName    = "country_name"
	IPDBFieldRegionName     = "region_name"
	IPDBFieldCityName       = "city_name"
	IPDBFieldISPDomain      = "isp_domain"
	IPDBFieldContinentCode  = "continent_code"
	IPDBFieldUTCOffset      = "utc_offset"
	IPDBFieldLatitude       = "latitude"
	IPDBFieldLongitude      = "longitude"
	IPDBFieldChinaAdminCode = "china_admin_code"
	IPDBFieldOwnerDomain    = "owner_domain"
	IPDBFieldTimezone       = "timezone"
	IPDBFieldIddCode        = "idd_code"
	IPDBFieldCountryCode    = "country_code"
	IPDBFieldIDC            = "idc"
	IPDBFieldBaseStation    = "base_station"
	IPDBFieldCountryCode3   = "country_code3"
	IPDBFieldEuropeanUnion  = "european_union"
	IPDBFieldCurrencyCode   = "currency_code"
	IPDBFieldCurrencyName   = "currency_name"
	IPDBFieldAnycast        = "anycast"
)

Variables

AWDBFieldsMap AWDB字段映射表

IPDBFieldsMap IPDB字段映射表

Functions

func IPDBFieldsMapping

func IPDBFieldsMapping(fields []string) []string

Types

type AWDB

type AWDB struct {

	// extra mapper
	ASNMapper mapper.Mapper
	// contains filtered or unexported fields
}

func NewAWDB

func NewAWDB(file, iplineFile string) *AWDB

func (*AWDB) Close

func (a *AWDB) Close()

func (*AWDB) LookupIPLine

func (a *AWDB) LookupIPLine(ip net.IP) (*net.IPNet, string)

func (*AWDB) LookupNetwork

func (a *AWDB) LookupNetwork(ip net.IP) (*net.IPNet, map[string]string, error)

type Database

type Database interface {
	LookupNetwork(ip net.IP) (*net.IPNet, map[string]string, error)
}

Database IP数据库的查询封装

type IPDB

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

func NewIPDB

func NewIPDB(file string) *IPDB

func (*IPDB) LookupNetwork

func (i *IPDB) LookupNetwork(ip net.IP) (*net.IPNet, map[string]string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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