Documentation ¶
Index ¶
- Constants
- func DigNS(domain string, timeout time.Duration) (nss []string)
- func DoReq(method string, url string, reqCB ReqCallback, parseCB ParseCallback, ...) (err error)
- func GetJson(url string, inParam any, timeout time.Duration, parseCb ParseCallback, ...) (err error)
- func GetLocalDNSServer() ([]string, error)
- func GetLocalIP() (net.IP, error)
- func GetPublicIP() (ip string, err error)
- func GetQuery(url string, param url.Values, timeout time.Duration, parseCb ParseCallback, ...) error
- func IsLocalIP(ip string) bool
- func IsPublicIP(IP net.IP) bool
- func LookupAddr(addr string) (domains []string, err error)
- func LookupAddrEx(addr string, timeout time.Duration) (domains []string, err error)
- func LookupCName(domain string) (cname string, err error)
- func LookupCNameEx(domain string, timeout time.Duration) (cname string, err error)
- func LookupIP(domain string) (ipRec []net.IP, err error)
- func LookupIPEx(domain string, timeout time.Duration) (ipRec []net.IP, err error)
- func LookupNS(domain string) (ns []string, err error)
- func LookupNSEx(domain string, timeout time.Duration) (ns []string, err error)
- func LookupNSWithSer(domain string, timeout time.Duration, serIP string) (list []string, err error)
- func LookupTXT(domain string) (txt []string, err error)
- func LookupTXTEx(domain string, timeout time.Duration) (txt []string, err error)
- func NewLongClient() *http.Client
- func PostForm(url string, values url.Values, timeout time.Duration, parseCb ParseCallback, ...) error
- func PostJson(url string, inParam any, timeout time.Duration, parseCb ParseCallback, ...) (err error)
- func RemoteIP(r *http.Request) string
- func SyncOP(listOP ...OPInfo) map[string]any
- func SyncOPByNum(goNum uint, listOP ...OPInfo) map[string]any
- type OPInfo
- type ParseCallback
- type ReqCallback
- type TrafficConn
Constants ¶
View Source
const ( HttpMethodGet = "GET" HttpMethodPost = "POST" )
View Source
const ( ContentTypeJson = "application/json" ContentTypeFormUrlencoded = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
func DoReq ¶
func DoReq(method string, url string, reqCB ReqCallback, parseCB ParseCallback, client *http.Client) (err error)
func GetLocalDNSServer ¶
func GetLocalIP ¶
func GetPublicIP ¶
func IsPublicIP ¶
func LookupAddr ¶
func LookupAddrEx ¶
func LookupCName ¶
func LookupCNameEx ¶
func LookupNSWithSer ¶
func NewLongClient ¶
Types ¶
type ParseCallback ¶
type ReqCallback ¶
type TrafficConn ¶ added in v1.11.14
TrafficConn 结构体用于包装 net.Conn,增加流量统计功能
func NewTrafficConn ¶ added in v1.11.14
func NewTrafficConn(conn net.Conn) *TrafficConn
func (*TrafficConn) GetTraffic ¶ added in v1.11.14
func (c *TrafficConn) GetTraffic() (rCount, wCount uint64)
func (*TrafficConn) Read ¶ added in v1.11.14
func (c *TrafficConn) Read(b []byte) (n int, err error)
Read 方法拦截读取操作并统计流量
func (*TrafficConn) ResetTraffic ¶ added in v1.11.14
func (c *TrafficConn) ResetTraffic()
func (*TrafficConn) TakeTraffic ¶ added in v1.11.14
func (c *TrafficConn) TakeTraffic() (rCount, wCount uint64)
Click to show internal directories.
Click to hide internal directories.