ip

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveGatewayIP added in v1.2.0

func DeriveGatewayIP(cidr string) string

DeriveGatewayIP gateway ip from cidr

func GetIPAtIndex added in v1.2.1

func GetIPAtIndex(ipNet net.IPNet, index int64) net.IP

GetIPAtIndex get the IP by index in the range of ipNet. The index is start with 0.

func IPAddrs2str added in v1.7.0

func IPAddrs2str(ips []netip.Addr) []string

func IPs2str

func IPs2str(ips []net.IP) []string

func IPsIntersect

func IPsIntersect(a []net.IP, b []net.IP) bool

IPsIntersect return is 2 set is intersect

func IPv6

func IPv6(ip net.IP) bool

func ToIP

func ToIP(addr string) (net.IP, error)

ToIP parse str to net.IP and return error is parse failed

func ToIPAddrs added in v1.7.0

func ToIPAddrs(addrs []string) ([]netip.Addr, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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