model

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

	// Province 省份
	Province = "province"

	// City 城市
	City = "city"

	// ISP 运营商
	ISP = "isp"

	// Continent 大洲
	Continent = "continent"

	// UTCOffset UTC偏移值
	UTCOffset = "utcOffset"

	// Latitude 纬度
	Latitude = "latitude"

	// Longitude 经度
	Longitude = "longitude"

	// ChinaAdminCode 中国行政区划代码
	ChinaAdminCode = "chinaAdminCode"
)
View Source
const (
	// IPv4 IP库版本 v4
	IPv4 uint16 = 0x01

	// IPv6 IP库版本 v6
	IPv6 uint16 = 0x02
)

Variables

CommonFields 公共字段

Functions

This section is empty.

Types

type IPDBMeta

type IPDBMeta struct {

	// Build 构建时间 10位时间戳
	Build int `json:"build"`

	// IPVersion IP库版本
	IPVersion uint16 `json:"ip_version"`

	// Languages 支持语言
	// value为语言对应的fields偏移量
	Languages map[string]int `json:"languages"`

	// NodeCount 节点数量
	NodeCount int `json:"node_count"`

	// TotalSize 节点区域和数据区域大小统计
	TotalSize int `json:"total_size"`

	// Fields 数据字段列表
	// 城市级别数据库包含13个字段
	// "country_name": "国家名称"
	// "region_name": "省份名称"
	// "city_name": "城市名称"
	// "owner_domain": "所有者"
	// "isp_domain": "运营商"
	// "latitude": "纬度"
	// "longitude": "经度"
	// "timezone": "时区"
	// "utc_offset": "UTC偏移量"
	// "china_admin_code": "中国邮编"
	// "idd_code": "电话区号"
	// "country_code": "国家代码"
	// "continent_code": "大陆代码"
	Fields []string `json:"fields"`
}

IPDBMeta ipdb 元数据

type Meta

type Meta struct {

	// IPVersion IP库版本
	IPVersion uint16

	// Fields 数据字段列表
	Fields []string
}

Meta 元数据

func (*Meta) IsIPv4Support

func (m *Meta) IsIPv4Support() bool

IsIPv4Support 是否支持 IPv4

func (*Meta) IsIPv6Support

func (m *Meta) IsIPv6Support() bool

IsIPv6Support 是否支持 IPv6

Jump to

Keyboard shortcuts

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