Documentation ¶
Index ¶
- Variables
- func Dial(addr string, timeout time.Duration) error
- func Get() (port int, err error)
- func GetClientIP(r *http.Request) (ip string)
- func GetDefaultInterfaceName() string
- func GetIPs() (ips []string)
- func GetInterfaceIP() (string, error)
- func GetIp138(ip string) string
- func GetLocalIP() (string, error)
- func GetLocalIP1() (ip string)
- func GetLocalIp() string
- func GetLocalMainIP() (string, int, error)
- func GetMacAddrs() (macAddrs []string)
- func GetOutboundIP() string
- func GetPublicIP() (string, error)
- func GetValidAddressCount(cidr string) int
- func GetWwwIP() (exip string)
- func IPv4() (net.IP, error)
- func InternalIp() string
- func Intersect(n1, n2 *net.IPNet) bool
- func IpAddress() string
- func LocalIP() (string, error)
- func LocalListener() net.Listener
- func LocalMac() (string, error)
- func Lower16BitIP() (uint16, error)
- func Ping(host string, port int) error
- func ToCommonString(ip string, prefix uint32) string
- func Upper16BitIP() (uint16, error)
- type URL
- func (u *URL) Password() (string, bool)
- func (u *URL) Query() url.Values
- func (u *URL) QueryBool(field string, expect bool) (ret bool)
- func (u *URL) QueryDuration(field string, expect time.Duration) (ret time.Duration)
- func (u *URL) QueryInt(field string, expect int) (ret int)
- func (u *URL) QueryInt64(field string, expect int64) (ret int64)
- func (u *URL) QueryString(field string, expect string) (ret string)
- func (u *URL) Username() string
Constants ¶
This section is empty.
Variables ¶
var NameServer = "ns1.google.com:53"
NameServer the name server to use for this lib
Functions ¶
func GetDefaultInterfaceName ¶
func GetDefaultInterfaceName() string
func GetInterfaceIP ¶
GetInterfaceIP get the ip of your interface, useful when you want to get your ip inside a private network, such as wifi network.
func GetLocalIp ¶
func GetLocalIp() string
func GetPublicIP ¶
GetPublicIP get the ip that is public to global.
func GetValidAddressCount ¶
func InternalIp ¶
func InternalIp() string
func Lower16BitIP ¶
func ToCommonString ¶
func Upper16BitIP ¶
Types ¶
type URL ¶
type URL struct { Scheme string Opaque string // encoded opaque data User *url.Userinfo // username and password information Host string // host or host:port Path string // path (relative paths may omit leading slash) RawPath string // encoded path hint (see EscapedPath method) ForceQuery bool // append a query ('?') even if RawQuery is empty RawQuery string // encoded query values, without '?' Fragment string // fragment for references, without '#' HostName string Port string // contains filtered or unexported fields }
URL wrap url.URL.
func (*URL) Query ¶
Query parses RawQuery and returns the corresponding values. It silently discards malformed value pairs. To check errors use ParseQuery.
func (*URL) QueryBool ¶
QueryBool returns provided field's value in bool if value is empty, expect returns
func (*URL) QueryDuration ¶
QueryDuration returns provided field's value in duration type. if value is empty, expect returns
func (*URL) QueryInt ¶
QueryInt returns provided field's value in int type. if value is empty, expect returns
func (*URL) QueryInt64 ¶
QueryInt64 returns provided field's value in int64 type. if value is empty, expect returns
func (*URL) QueryString ¶
QueryString returns provided field's value in string type. if value is empty, expect returns