net

package
v0.0.0-...-89b14fa Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPv4 = "IPv4"
	IPv6 = "IPv6"
)

Variables

This section is empty.

Functions

func CIDRStringToName

func CIDRStringToName(s string) string

CIDRToName converts CIDR string to resource name.

func CIDRToName

func CIDRToName(cidr *net.IPNet) string

CIDRToName converts CIDR to resource name.

func CountFromMaskSize

func CountFromMaskSize(version string, maskSize int) (*big.Int, error)

CountFromMaskSize calculates the number of IP addresses based on the size of the subnet mask.

func IPToName

func IPToName(ip net.IP) string

IPToName converts IP address to resource name.

func NameToCIDR

func NameToCIDR(version, name string) (*net.IPNet, error)

NameToCIDR converts resource name to CIDR based on the IP version.

func NameToCIDRIP

func NameToCIDRIP(version, name string) (*net.IPNet, error)

NameToCIDRIP converts resource name to IP address(CIDR) based on the IP version.

func NameToIP

func NameToIP(version, name string) (net.IP, error)

NameToIP converts resource name to IP address based on the IP version.

func NamesToCIDRIPRanges

func NamesToCIDRIPRanges(version string, names ...string) (*iprange.IPRanges, error)

NamesToCIDRIPRanges converts resource names to IPRanges (CIDR) based on the IP version.

func NamesToIPIPRanges

func NamesToIPIPRanges(version string, names ...string) (*iprange.IPRanges, error)

NamesToIPIPRanges converts resource names to IPRanges (IP) based on the IP version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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