Documentation ¶
Index ¶
- Constants
- Variables
- type ASNInfo
- type BaseStation
- func (db *BaseStation) BuildTime() time.Time
- func (db *BaseStation) Fields() []string
- func (db *BaseStation) Find(addr, language string) ([]string, error)
- func (db *BaseStation) FindInfo(addr, language string) (*BaseStationInfo, error)
- func (db *BaseStation) FindMap(addr, language string) (map[string]string, error)
- func (db *BaseStation) IsIPv4() bool
- func (db *BaseStation) IsIPv6() bool
- func (db *BaseStation) Languages() []string
- func (db *BaseStation) Reload(name string) error
- type BaseStationInfo
- type City
- func (db *City) BuildTime() time.Time
- func (db *City) Fields() []string
- func (db *City) Find(addr, language string) ([]string, error)
- func (db *City) FindInfo(addr, language string) (*CityInfo, error)
- func (db *City) FindMap(addr, language string) (map[string]string, error)
- func (db *City) IsIPv4() bool
- func (db *City) IsIPv6() bool
- func (db *City) Languages() []string
- func (db *City) Reload(name string) error
- type CityInfo
- type District
- func (db *District) BuildTime() time.Time
- func (db *District) Fields() []string
- func (db *District) Find(addr, language string) ([]string, error)
- func (db *District) FindInfo(addr, language string) (*DistrictInfo, error)
- func (db *District) FindMap(addr, language string) (map[string]string, error)
- func (db *District) IsIPv4() bool
- func (db *District) IsIPv6() bool
- func (db *District) Languages() []string
- func (db *District) Reload(name string) error
- type DistrictInfo
- type Download
- type IDC
- func (db *IDC) BuildTime() time.Time
- func (db *IDC) Fields() []string
- func (db *IDC) Find(addr, language string) ([]string, error)
- func (db *IDC) FindInfo(addr, language string) (*IDCInfo, error)
- func (db *IDC) FindMap(addr, language string) (map[string]string, error)
- func (db *IDC) IsIPv4() bool
- func (db *IDC) IsIPv6() bool
- func (db *IDC) Languages() []string
- func (db *IDC) Reload(name string) error
- type IDCInfo
- type MetaData
Constants ¶
View Source
const IPv4 = 0x01
View Source
const IPv6 = 0x02
Variables ¶
View Source
var ( ErrFileSize = errors.New("IP Database file size error.") ErrMetaData = errors.New("IP Database metadata error.") ErrReadFull = errors.New("IP Database ReadFull error.") ErrDatabaseError = errors.New("database error") ErrIPFormat = errors.New("Query IP Format error.") ErrNoSupportLanguage = errors.New("language not support") ErrNoSupportIPv4 = errors.New("IPv4 not support") ErrNoSupportIPv6 = errors.New("IPv6 not support") ErrDataNotExists = errors.New("data is not exists") )
Functions ¶
This section is empty.
Types ¶
type BaseStation ¶
type BaseStation struct {
// contains filtered or unexported fields
}
func NewBaseStation ¶
func NewBaseStation(name string) (*BaseStation, error)
func (*BaseStation) BuildTime ¶
func (db *BaseStation) BuildTime() time.Time
func (*BaseStation) Fields ¶
func (db *BaseStation) Fields() []string
func (*BaseStation) FindInfo ¶
func (db *BaseStation) FindInfo(addr, language string) (*BaseStationInfo, error)
func (*BaseStation) FindMap ¶
func (db *BaseStation) FindMap(addr, language string) (map[string]string, error)
func (*BaseStation) IsIPv4 ¶
func (db *BaseStation) IsIPv4() bool
func (*BaseStation) IsIPv6 ¶
func (db *BaseStation) IsIPv6() bool
func (*BaseStation) Languages ¶
func (db *BaseStation) Languages() []string
func (*BaseStation) Reload ¶ added in v1.2.0
func (db *BaseStation) Reload(name string) error
type BaseStationInfo ¶
type City ¶
type City struct {
// contains filtered or unexported fields
}
City struct
func NewCityFromBytes ¶ added in v1.3.3
type CityInfo ¶
type CityInfo struct { CountryName string `json:"country_name"` RegionName string `json:"region_name"` CityName string `json:"city_name"` DistrictName string `json:"district_name"` OwnerDomain string `json:"owner_domain"` IspDomain string `json:"isp_domain"` Latitude string `json:"latitude"` Longitude string `json:"longitude"` Timezone string `json:"timezone"` UtcOffset string `json:"utc_offset"` ChinaRegionCode string `json:"china_region_code"` ChinaCityCode string `json:"china_city_code"` ChinaAdminCode string `json:"china_admin_code"` IddCode string `json:"idd_code"` CountryCode string `json:"country_code"` ContinentCode string `json:"continent_code"` IDC string `json:"idc"` BaseStation string `json:"base_station"` CountryCode3 string `json:"country_code3"` EuropeanUnion string `json:"european_union"` CurrencyCode string `json:"currency_code"` CurrencyName string `json:"currency_name"` Anycast string `json:"anycast"` Line string `json:"line"` DistrictInfo DistrictInfo `json:"district_info"` Route string `json:"route"` ASN string `json:"asn"` ASNInfo []ASNInfo `json:"asn_info"` AreaCode string `json:"area_code"` UsageType string `json:"usage_type"` }
CityInfo is City Database Content
type District ¶
type District struct {
// contains filtered or unexported fields
}
func NewDistrict ¶
func (*District) FindInfo ¶
func (db *District) FindInfo(addr, language string) (*DistrictInfo, error)
type DistrictInfo ¶
type DistrictInfo struct { CountryName string `json:"country_name"` RegionName string `json:"region_name"` CityName string `json:"city_name"` DistrictName string `json:"district_name"` ChinaAdminCode string `json:"china_admin_code"` CoveringRadius string `json:"covering_radius"` Latitude string `json:"latitude"` Longitude string `json:"longitude"` }
type Download ¶ added in v1.3.2
func NewDownload ¶ added in v1.3.2
func (*Download) SaveToFile ¶ added in v1.3.2
Click to show internal directories.
Click to hide internal directories.