network

package
v0.0.0-...-6e9d532 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeAddress

func NormalizeAddress(addr, defaultPort string) (string, error)

NormalizeAddress returns addr with the passed default port appended if there is not already a port specified.

func NormalizeAddresses

func NormalizeAddresses(addrs []string, defaultPort string) ([]string, error)

NormalizeAddresses returns a new slice with all the passed peer addresses normalized with the given default port, and all duplicates removed.

func ParseListeners

func ParseListeners(addrs []string) ([]net.Addr, error)

ParseListeners determines whether each listen address is IPv4 and IPv6 and returns a slice of appropriate net.Addrs to listen on with TCP. It also properly detects addresses which apply to "all interfaces" and adds the address as both IPv4 and IPv6.

Types

This section is empty.

Jump to

Keyboard shortcuts

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