util

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPAdd

func IPAdd(ip net.IP, val int64) net.IP

IPAdd adds `val` to `ip`. If `ip` is IPv4 address, the value returned is IPv4, or nil when over/underflowed. If `ip` is IPv6 address, the value returned is IPv6, or nil when over/underflowed.

func IPDiff

func IPDiff(ip1, ip2 net.IP) int64

IPDiff calculates the numeric difference between two IP addresses. Intuitively, the calculation is done as `ip2 - ip1`. `ip1` and `ip2` must be the same IP version (4 or 6).

Types

This section is empty.

Jump to

Keyboard shortcuts

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