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 ¶
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.
Click to show internal directories.
Click to hide internal directories.