network

package
v0.0.0-...-eec02a6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DNS1123LabelRegex  = regexp.MustCompile(`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`)
	DNS1123DomainRegex = regexp.MustCompile(`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`)
)

Functions

func EnsureHostportFormatted

func EnsureHostportFormatted(hostport string) string

EnsureHostportFormatted ensures IPv6 hostport is in correct format

func FilterIPs

func FilterIPs(ctx context.Context, ips, cidrs []string) ([]string, error)

FilterIPs takes a list of IPs and CIDRs and returns the sorted list of IPs that are contained by one or more of the CIDRs

func GetBaseImageName

func GetBaseImageName(name string) string

GetBaseImageName accepts a container image name and return just the base image.

func IPv6Check

func IPv6Check(ip string) bool

func ParseHostportIP

func ParseHostportIP(hostport string) string

ParseHostportIP returns just the IP address part of the given input IP address and strips any port information

func ReplaceImageRegistry

func ReplaceImageRegistry(image, registry string) string

ReplaceImageRegistry accepts a container image name and a registry name (FQDN[:port]/[subdir]*) and returns the same image name with the supplied registry.

func ValidateCIDRs

func ValidateCIDRs(ctx context.Context, cidrs []string) error

ValidateCIDRs checks if a list of CIDR blocks are valid and returns a multi error containing all errors which may occur during the parsing process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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