Documentation
¶
Index ¶
- Constants
- Variables
- func GetInsideIp(ctx context.Context) string
- func GetMacAddr(ctx context.Context) (arrays []string)
- func GetOutsideIp(ctx context.Context) string
- func Ips(ctx context.Context) (map[string]string, error)
- func IsIp(ipStr string) string
- func IsIpConsistent(ipStr1, ipStr2 string) bool
- type AnalyseResult
- type Client
- func (c *Client) Analyse(ip string) (resp AnalyseResult)
- func (c *Client) CheckIpv4(ips string) bool
- func (c *Client) CheckIpv6(ips string) bool
- func (c *Client) Close()
- func (c *Client) GetGeo() *geoip.Client
- func (c *Client) GetQqWry() *qqwry.Client
- func (c *Client) QueryGeoIp(ipAddress string) (result geoip.QueryCityResult, err error)
- func (c *Client) QueryQqWry(ipAddress string) (result qqwry.QueryResult, err error)
- type ClientConfig
Constants ¶
View Source
const Version = "1.0.48"
Variables ¶
View Source
var (
QueryIncorrect = errors.New("ip地址不正确")
)
Functions ¶
func GetMacAddr ¶ added in v1.0.21
GetMacAddr 获取Mac地址
func IsIpConsistent ¶ added in v1.0.37
IsIpConsistent 两个ip是否一致
Types ¶
type AnalyseResult ¶
type AnalyseResult struct {
Ip string `json:"ip"` // ip
Continent string `json:"continent"` // 大陆
Country string `json:"country"` // 国家
Province string `json:"province"` // 省份
City string `json:"city"` // 城市
Isp string `json:"isp"` // 运营商
LocationTimeZone string `json:"location_time_zone"` // 位置时区
LocationLatitude float64 `json:"location_latitude"` // 位置纬度
LocationLongitude float64 `json:"location_longitude"` // 位置经度
}
type Client ¶ added in v1.0.21
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Analyse ¶ added in v1.0.21
func (c *Client) Analyse(ip string) (resp AnalyseResult)
func (*Client) QueryGeoIp ¶ added in v1.0.31
func (c *Client) QueryGeoIp(ipAddress string) (result geoip.QueryCityResult, err error)
QueryGeoIp ip2region https://www.maxmind.com/
func (*Client) QueryQqWry ¶ added in v1.0.31
func (c *Client) QueryQqWry(ipAddress string) (result qqwry.QueryResult, err error)
QueryQqWry 纯真IP库 https://www.cz88.net/
Click to show internal directories.
Click to hide internal directories.