Documentation
¶
Index ¶
- Constants
- Variables
- func BigIntToIPv6(ipaddr big.Int) net.IP
- func CutIP(ip string) string
- func IP2Int(ip net.IP) *big.Int
- func IPV4ToIPV6(ipv4 string) string
- func IPV6ToString(ipv6 *big.Int) string
- func IPv4ToInt(ipaddr net.IP) (uint32, error)
- func IPv6ToBigInt(ipaddr net.IP) *big.Int
- func IPv6ToInt(ipaddr net.IP) ([2]uint64, error)
- func IntToIPv4(ipaddr uint32) net.IP
- func IntToIPv6(high, low uint64) net.IP
- func MergeStruct(record1 interface{}, record2 interface{}) error
- func ParseIP(s string) (net.IP, int, error)
Constants ¶
View Source
const ( ArrayLenForIP = 8 LowPosition = 8 HighPosition = 16 IPV6Prefix = "::ffff:" IPBytesCut = 15 // 15 bytes (120 bits) )
Variables ¶
Functions ¶
func BigIntToIPv6 ¶
BigIntToIPv6 converts IP address of version 6 from big integer to net.IP representation.
func IPV4ToIPV6 ¶
func IPV6ToString ¶
func IPv6ToBigInt ¶
IPv6ToBigInt converts IP address of version 6 from net.IP to math big integer representation.
func IPv6ToInt ¶
IPv6ToInt converts IP address of version 6 from net.IP to uint64 array representation. Return value contains high integer value on the first place and low integer value on second place.
func IntToIPv6 ¶
IntToIPv6 converts IP address of version 6 from integer (high and low value) to net.IP representation.
func MergeStruct ¶
func MergeStruct(record1 interface{}, record2 interface{}) error
MergeStruct help to fill all existing fields of record1 by record2
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.