networking

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyPort      = errors.New("port cannot be empty")
	ErrInvalidFormat  = errors.New("invalid port format")
	ErrPortOutOfRange = errors.New("port number must be between 1 and 65535")
)

Common port validation errors

Functions

func ValidatePort

func ValidatePort(portStr string) (string, error)

ValidatePort checks if the provided port string is valid and returns a clean, normalized version. It accepts formats like ":8080", "localhost:8080", "127.0.0.1:8080", or just "8080". Returns the normalized port format (":PORT") and an error if the port is invalid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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