netex

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Ipv4SplitCharacter use for slipt Ipv4
	Ipv4SplitCharacter = "."
	// Ipv6SplitCharacter use for slipt Ipv6
	Ipv6SplitCharacter = ":"
)

Variables

This section is empty.

Functions

func CheckIpv4Validity

func CheckIpv4Validity(IPString string) bool

func CheckIpv6Validity

func CheckIpv6Validity(IPString string) bool

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 DecodeToGBK(text string) (string, error)

func GetAllIntranetIP added in v0.1.1

func GetAllIntranetIP() (ips []string, err error)

IntranetIP 内网IP

func GetCityByIp

func GetCityByIp(ip string) string

func GetClientIP

func GetClientIP(r *http.Request) (ip string)

GetClientIP 获取用户ip

func GetDynamicPageHtmlContent added in v0.0.7

func GetDynamicPageHtmlContent(url string) (htmlContent string, err error)

func GetExtranetIP added in v0.1.1

func GetExtranetIP() (ip string, err error)

func GetFirstAddressOf

func GetFirstAddressOf(name string) (string, error)

GetFirstAddressOf returns the first IPv4 address of the supplied interface name.

func GetInternalIP

func GetInternalIP() (string, error)

GetInternalIP get internal ip.

func GetLocalDnsName added in v0.1.1

func GetLocalDnsName() (hostname string, err error)

func GetMxrr

func GetMxrr(domain string) (isMx bool, mxs []*net.MX, err error)

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 GetOutboundIP() (string, error)

func HTTPBuildQuery

func HTTPBuildQuery(pairs map[string]string) string

HTTPBuildQuery Generates a URL-encoded query string from the associative map

func HostAddress

func HostAddress(host string, port int) string

func HostAddress2

func HostAddress2(host string, port string) string

func HostPort

func HostPort(addr string) (string, string, error)

func IP2long

func IP2long(ipAddr string) (uint32, error)

IP2long converts a string containing an (IPv4) Internet Protocol dotted address into a long integer

func IsPrivateIP

func IsPrivateIP(ipAddr string) bool

func IsRedirect added in v0.0.2

func IsRedirect(resp *http.Response) bool

func IsSameAddr

func IsSameAddr(a1, a2 net.Addr) bool

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

func ListenOnUDPRandomPort(ip string) (*net.UDPConn, error)

ListenOnUDPRandomPort a udp endpoint listening on a random port

func Long2ip

func Long2ip(ipLong uint32) string

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.

func MatchIP added in v0.1.1

func MatchIP(pattern, host, port string) bool

MatchIP is used to determine whether @pattern and @host:@port match, It's supports subnet/range

func ParseURL added in v0.0.2

func ParseURL(uri string) *url.URL

func WSHostAddress

func WSHostAddress(host string, port int, path string) string

func WSHostAddress2

func WSHostAddress2(host string, port string, path string) string

func WSSHostAddress

func WSSHostAddress(host string, port int, path string) string

func WSSHostAddress2

func WSSHostAddress2(host string, port string, path string) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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