net

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ProtocolIcmp  = 1
	ProtocolTcp   = 6
	ProtocolUdp   = 17
	ProtocolIcmp6 = 58
)
View Source
const Localhost = "localhost"

Variables

This section is empty.

Functions

func GetIpVersion

func GetIpVersion(ip *net.IP) int

func GetStartEndCidr

func GetStartEndCidr(startIpAddress *net.IP, endIpAddress *net.IP, checkBoundary bool) (string, error)

func IntToIpv4

func IntToIpv4(ipNum uint32) net.IP

IntToIpv4 converts IPv4 number to net.IP.

func IsLocalhost added in v1.16.0

func IsLocalhost(hostname string) bool

IsLocalhost reports whether the hostname names the machine it is resolved on. RFC 6761 reserves "localhost" and everything under it for the purpose, so the subdomains count too.

func NetworkFromTarget

func NetworkFromTarget(target string) (*net.IPNet, error)

func ParseAddressNet

func ParseAddressNet(addressNet string) (*net.IPNet, error)

func SplitAddress

func SplitAddress(address string) (string, int, error)

Types

This section is empty.

Directories

Path Synopsis
Package publicsuffix provides a public suffix list based on data from https://publicsuffix.org/
Package publicsuffix provides a public suffix list based on data from https://publicsuffix.org/
targetpolicy module
types

Jump to

Keyboard shortcuts

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