iputil

package
v0.0.0-...-df362b2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CIDRtoIPRange

func CIDRtoIPRange(cidr string) (string, error)

CIDRtoIPRange converts a CIDR block to an IP range.

func GetPTRs

func GetPTRs(ip string) ([]string, error)

GetPTRs returns the PTR record for the given IP address.

func IPRangeToCIDR

func IPRangeToCIDR(ipRange string) ([]string, error)

IPRangeToCIDR converts an IP range to a slice of CIDR blocks.

func IPsToCIDR

func IPsToCIDR(IPs []string) (cidrs []string, err error)

IPsToCIDR converts a slice of IPs to a slice of CIDR blocks.

func IPsToRange

func IPsToRange(IPs []string) ([]string, error)

IPsToRange takes a slice of IP strings and returns a slice of IP ranges.

func IsCIDR

func IsCIDR(str string) bool

IsCIDR checks if the provided string is a CIDR.

func IsIP

func IsIP(str string) bool

IsIPAddress checks if the provided string is an IP address with optional port.

func IsIPInCIDR

func IsIPInCIDR(ip string, cidr string) bool

IsIPInCIDR checks if the provided IP address is within the provided CIDR.

func IsIPInRange

func IsIPInRange(ip string, ipRange string) bool

IsIPInRange checks if the provided IP address is within the provided IP range.

func IsIPRange

func IsIPRange(str string) bool

IsIPRange checks if the provided string is a valid IP range.

func IsIPv4

func IsIPv4(ip string) bool

IsIPv4 checks if the provided IP address is an IPv4 address.

func IsIPv6

func IsIPv6(ip string) bool

IsIPv6 checks if the provided IP address is an IPv6 address.

func IsPrivateIP

func IsPrivateIP(ipStr string) bool

IsPrivateIP checks if the given IP is a private address.

func IsPublicIP

func IsPublicIP(ip string) bool

IsPublicIP checks if the provided IP address is a public IP address.

func IsURLIP

func IsURLIP(str string) bool

IsURLIP checks if the provided string is a URL with an IP address.

func IsValidCIDR

func IsValidCIDR(cidr string) bool

IsValidCIDR checks if the provided CIDR is valid.

func IsValidIP

func IsValidIP(ip string) bool

IsValidIP checks if the provided IP address is valid.

func IsValidIPRange

func IsValidIPRange(ipRange string) bool

IsValidIPRange checks if the provided IP range is valid.

func IsValidNetworkInput

func IsValidNetworkInput(str string) bool

IsValidNetworkInput checks if the provided string is a valid IP address, CIDR or IP range.

func ParseCIDR

func ParseCIDR(cidr string) ([]net.IP, error)

ParseCIDR parses the provided CIDR block and returns a slice of IP addresses.

func ParseIPRange

func ParseIPRange(ipRange string) ([]net.IP, error)

ParseIPRange parses the provided IP range and returns a slice of IP addresses.

Types

This section is empty.

Jump to

Keyboard shortcuts

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