Documentation
¶
Index ¶
- Variables
- func Get() (port int, err error)
- func GetClientIP(r *http.Request) (ip string)
- func GetDefaultInterfaceName() string
- func GetInterfaceIP() (string, error)
- func GetIp138(ip string) string
- func GetLocalIP() (ip string)
- func GetLocalIp() string
- func GetOutboundIP() string
- func GetPublicIP() (string, error)
- func GetValidAddressCount(cidr string) int
- func GetWwwIP() (exip string)
- func Intersect(n1, n2 *net.IPNet) bool
- func IpAddress() string
- func LocalIP() (string, error)
- func LocalMac() (string, error)
- func ToCommonString(ip string, prefix uint32) string
Constants ¶
This section is empty.
Variables ¶
View Source
var NameServer = "ns1.google.com:53"
NameServer the name server to use for this lib
Functions ¶
func GetClientIP ¶ added in v0.2.19
GetClientIP 获取用户ip
func GetDefaultInterfaceName ¶ added in v0.2.45
func GetDefaultInterfaceName() string
func GetInterfaceIP ¶ added in v0.2.45
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 ¶ added in v0.2.30
func GetLocalIp() string
func GetOutboundIP ¶ added in v0.2.45
func GetOutboundIP() string
Get preferred outbound ip of this machine
func GetPublicIP ¶ added in v0.2.45
GetPublicIP get the ip that is public to global.
func GetValidAddressCount ¶ added in v0.2.45
func ToCommonString ¶ added in v0.2.45
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.