xnet

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyIPv4Address

func AnyIPv4Address(port int) string

AnyIPv4Address returns an IPv4 meta address "0.0.0.0" with a port that represents any IP address listening on that port.

func IncreasePort

func IncreasePort(addr string) (string, error)

IncreasePort increases a port number by 1. This can be useful to generate port ranges or consecutive port numbers for the same address.

func IncreasePortBy

func IncreasePortBy(addr string, inc uint64) (string, error)

IncreasePortBy increases a port number by a factor of "inc". This can be useful to generate port ranges or consecutive port numbers for the same address.

func LocalhostIPv4Address

func LocalhostIPv4Address(port int) string

LocalhostIPv4Address returns a localhost IPv4 address with a port that represents the localhost IP address listening on that port.

func MustIncreasePortBy

func MustIncreasePortBy(addr string, inc uint64) string

MustIncreasePortBy calls IncreasePortBy and panics on error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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