Documentation ¶
Overview ¶
Package getip 获取 ip 信息包
Index ¶
- Variables
- func IPInfo(https bool) (ipAddr string, err error)
- func IPInfoByClient(c *requester.HTTPClient) (ipAddr string, err error)
- func IPInfoFromNetease() (ipAddr string, err error)
- func IPInfoFromNeteaseByClient(c *requester.HTTPClient) (ipAddr string, err error)
- func IPInfoFromTechainBaidu() (ipAddr string, err error)
- func IPInfoFromTechainBaiduByClient(c *requester.HTTPClient) (ipAddr string, err error)
- type IPResNetease
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrParseIP 解析ip地址错误 ErrParseIP = errors.New("parse ip error") )
Functions ¶
func IPInfoByClient ¶
func IPInfoByClient(c *requester.HTTPClient) (ipAddr string, err error)
IPInfoByClient 给定client获取ip地址
func IPInfoFromNetease ¶
IPInfoFromNetease 从网易服务器获取ip
func IPInfoFromNeteaseByClient ¶
func IPInfoFromNeteaseByClient(c *requester.HTTPClient) (ipAddr string, err error)
func IPInfoFromTechainBaidu ¶
IPInfoFromTechainBaidu 从 techain.baidu.com 获取ip
func IPInfoFromTechainBaiduByClient ¶
func IPInfoFromTechainBaiduByClient(c *requester.HTTPClient) (ipAddr string, err error)
Types ¶
type IPResNetease ¶
type IPResNetease struct { Result string `json:"result"` Code int `json:"code"` Message string `json:"message"` }
IPResNetease 网易服务器获取ip返回的结果
Click to show internal directories.
Click to hide internal directories.