Documentation
¶
Index ¶
- func BytesToString(bytes []byte) string
- func GetFirstIP() (string, error)
- func GetFirstPrivateIP() (string, error)
- func GetIPv4List() ([]string, error)
- func GetOneIP() (string, error)
- func GetPrivateIPList() ([]string, error)
- func IPtoUInt(ip string) uint32
- func IsPrivateIP(ip string) bool
- func JavaStringHash(s string) uint32
- func SnowFlakeID() string
- func StringToBytes(str string) []byte
- func UInt64UUID() (uint64, error)
- type ExponentialBackoff
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFirstIP ¶
GetFirstIP gets the first IP of the current host
func GetFirstPrivateIP ¶
GetFirstPrivateIP gets the first private IP of the current host
func GetIPv4List ¶ added in v0.5.3
GetIPv4List obtain all valid local addresses
func GetOneIP ¶ added in v0.5.3
GetOneIP obtain a valid ip address of the current host, with private ip preferred
func GetPrivateIPList ¶
GetPrivateIPList gets all the private IPs of the current host
func IsPrivateIP ¶
IsPrivateIP checks if an IP is a private one, according to the tencent rules 内网保留IP参考KM: /q/view/210875
func JavaStringHash ¶
JavaStringHash and Java String.hashCode() equivalent
Types ¶
Click to show internal directories.
Click to hide internal directories.