ipfamily

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Family

type Family string

IP family helps identifying single stack IPv4/IPv6 vs Dual-stack ["IPv4", "IPv6"] or ["IPv6", "Ipv4"].

const (
	IPv4      Family = "ipv4"
	IPv6      Family = "ipv6"
	DualStack Family = "dual"
	Unknown   Family = "unknown"
)

func ForAddress

func ForAddress(ip net.IP) Family

ForAddress returns the address family for a given address.

func ForAddresses

func ForAddresses(ips ...string) (Family, error)

ForAddresses returns the address family given list of addresses strings.

func ForAddressesIPs

func ForAddressesIPs(ips []net.IP) (Family, error)

ForAddressesIPs returns the address family from a given list of addresses IPs.

func ForCIDR

func ForCIDR(cidr *net.IPNet) Family

ForCIDR returns the address family from a given CIDR.

func ForCIDRString

func ForCIDRString(cidr string) Family

ForCIDRString returns the address family from a given CIDR in string format.

func ForService

func ForService(svc *v1.Service) (Family, error)

ForService returns the address family of a given service.

Jump to

Keyboard shortcuts

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