ip

package
v0.0.0-...-191046f Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package ip provides validation and parsing utilities.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoAddress is returned when no address is provided.
	ErrNoAddress = errors.New("no adddress provided")
	// ErrPortInvalid is returned when the provided port is below 0.
	ErrPortInvalid = errors.New("port must be >= 0")
	// ErrInvalidIP is returned an invalid IP is provided.
	ErrInvalidIP = errors.New("invalid IP provided, must be between 0 and 65535")
)

Functions

func GetHTTP3Network

func GetHTTP3Network(originalNetwork string) string

GetHTTP3Network maps tcp -> udp.

func ParsePort

func ParsePort(address string) (int, error)

ParsePort will take the port from an address and return it as int.

func RegisterNetworkHTTP3

func RegisterNetworkHTTP3(originalNetwork, h3Network string)

RegisterNetworkHTTP3 registers a mapping from non-HTTP/3 network to HTTP/3 network. This should be called during init() and will panic if the network type is standard, reserved, or already registered.

EXPERIMENTAL: Subject to change.

func ValidateAddress

func ValidateAddress(address string) error

ValidateAddress will do basic validation on an address string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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