Documentation ¶
Index ¶
- Constants
- func CheckIpv4Validity(IPString string) bool
- func CheckIpv6Validity(IPString string) bool
- func CheckPingOk(addr string, interval int, count int, timeout int, lossRateOk float64) (bool, error)
- func DecodeToGBK(text string) (string, error)
- func GetAllIntranetIP() (ips []string, err error)
- func GetCityByIp(ip string) string
- func GetClientIP(r *http.Request) (ip string)
- func GetDynamicPageHtmlContent(url string) (htmlContent string, err error)
- func GetExtranetIP() (ip string, err error)
- func GetFirstAddressOf(name string) (string, error)
- func GetInternalIP() (string, error)
- func GetLocalDnsName() (hostname string, err error)
- func GetMxrr(domain string) (isMx bool, mxs []*net.MX, err error)
- func GetOutboundIP() (string, error)
- func HTTPBuildQuery(pairs map[string]string) string
- func HostAddress(host string, port int) string
- func HostAddress2(host string, port string) string
- func HostPort(addr string) (string, string, error)
- func IP2long(ipAddr string) (uint32, error)
- func IsPrivateIP(ipAddr string) bool
- func IsRedirect(resp *http.Response) bool
- func IsSameAddr(a1, a2 net.Addr) bool
- func ListenOnTCPRandomPort(ip string) (*net.TCPListener, error)
- func ListenOnUDPRandomPort(ip string) (*net.UDPConn, error)
- func Long2ip(ipLong uint32) string
- func MacAddrs() (macAddrs []string)
- func MatchIP(pattern, host, port string) bool
- func ParseURL(uri string) *url.URL
- func WSHostAddress(host string, port int, path string) string
- func WSHostAddress2(host string, port string, path string) string
- func WSSHostAddress(host string, port int, path string) string
- func WSSHostAddress2(host string, port string, path string) string
Constants ¶
const ( // Ipv4SplitCharacter use for slipt Ipv4 Ipv4SplitCharacter = "." // Ipv6SplitCharacter use for slipt Ipv6 Ipv6SplitCharacter = ":" )
Variables ¶
This section is empty.
Functions ¶
func CheckIpv4Validity ¶
func CheckIpv6Validity ¶
func CheckPingOk ¶ added in v0.0.7
func CheckPingOk(addr string, interval int, count int, timeout int, lossRateOk float64) (bool, error)
need to run as root interval and timout are in seconds
func DecodeToGBK ¶ added in v0.0.7
func GetAllIntranetIP ¶ added in v0.1.1
IntranetIP 内网IP
func GetCityByIp ¶
func GetDynamicPageHtmlContent ¶ added in v0.0.7
func GetExtranetIP ¶ added in v0.1.1
func GetFirstAddressOf ¶
GetFirstAddressOf returns the first IPv4 address of the supplied interface name.
func GetLocalDnsName ¶ added in v0.1.1
func GetMxrr ¶
GetMxrr Get MX records corresponding to a given Internet host name Returns TRUE if any records are found; returns FALSE if no records were found or if an error occurred
func GetOutboundIP ¶
func HTTPBuildQuery ¶
HTTPBuildQuery Generates a URL-encoded query string from the associative map
func HostAddress ¶
func HostAddress2 ¶
func IP2long ¶
IP2long converts a string containing an (IPv4) Internet Protocol dotted address into a long integer
func IsPrivateIP ¶
func IsRedirect ¶ added in v0.0.2
func IsSameAddr ¶
func ListenOnTCPRandomPort ¶ added in v0.1.1
func ListenOnTCPRandomPort(ip string) (*net.TCPListener, error)
ListenOnTCPRandomPort a tcp server listening on a random port by tcp protocol
func ListenOnUDPRandomPort ¶ added in v0.1.1
ListenOnUDPRandomPort a udp endpoint listening on a random port
func Long2ip ¶
Long2ip converts an long integer address into a string in (IPv4) Internet standard dotted format
func MacAddrs ¶ added in v0.1.1
func MacAddrs() (macAddrs []string)
MacAddrs return all net-interface's hardware addresses.
Types ¶
This section is empty.