portutil

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePortSpec

func ParsePortSpec(portSpec string) (*port.Spec, error)

ParsePortSpec parses a Docker-like representation of PortSpec, but with support for both "parent IP" and "child IP" (optional); e.g. "127.0.0.1:8080:80/tcp", or "127.0.0.1:8080:10.0.2.100:80/tcp"

Format is as follows:

<parent IP>:<parent port>[:<child IP>]:<child port>/<proto>

Note that (child IP being optional) the format can either contain 5 or 4 components. When using IPv6 IP addresses, addresses must use square brackets to prevent the colons being mistaken for delimiters. For example:

[::1]:8080:[::2]:80/udp

func ValidatePortSpec

func ValidatePortSpec(spec port.Spec, existingPorts map[int]*port.Status) error

ValidatePortSpec validates *port.Spec. existingPorts can be optionally passed for detecting conflicts.

Types

This section is empty.

Jump to

Keyboard shortcuts

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