package
0.3.1
Repository: https://github.com/u2takey/go-utils.git
Documentation: pkg.go.dev

# Functions

AddIPOffset adds the provided integer offset to a base big.Int representing a net.IP NOTE: If you started with a v4 address and overflow it, you get a v6 result.
BigForIP creates a big.Int based on the provided net.IP.
GetIndexedIP returns a net.IP that is subnet.IP + index in the contiguous IP space.
IsDualStackCIDRs returns if - all are valid cidrs - at least one cidr from each family (v4 or v6).
IsDualStackCIDRStrings returns if - all are valid cidrs - at least one cidr from each family (v4 or v6).
IsDualStackIPs returns if a slice of ips is: - all are valid ips - at least one ip from each family (v4 or v6).
IsDualStackIPStrings returns if - all are valid ips - at least one ip from each family (v4 or v6).
IsIPv6 returns if netIP is IPv6.
IsIPv6CIDR returns if a cidr is ipv6.
IsIPv6CIDRString returns if cidr is IPv6.
IsIPv6String returns if ip is IPv6.
NewLocalPort returns a LocalPort instance and ensures IPFamily and IP are consistent and that the given protocol is valid.
ParseCIDRs parses a list of cidrs and return error if any is invalid.
ParseIPNets parses string slice to IPNetSet.
ParseIPSet parses string slice to IPSet.
ParsePort parses a string representing an IP port.
RangeSize returns the size of a range in valid addresses.

# Constants

Constants for valid IPFamilys:.
Constants for valid IPFamilys:.
Constants for valid protocols:.
Constants for valid protocols:.

# Variables

ListenPortOpener opens ports by calling bind() and listen().

# Structs

LocalPort represents an IP address and port pair along with a protocol and potentially a specific IP family.

# Interfaces

Closeable closes an opened LocalPort.
PortOpener can open a LocalPort and allows later closing it.

# Type aliases

IPFamily refers to a specific family if not empty, i.e.
IPNetSet maps string to net.IPNet.
IPSet maps string to net.IP.
Protocol is a network protocol support by LocalPort.