netutil

package
v0.39.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Host

func Host(addr net.Addr) string

Host returns the host of net.Addr.

func HostPort

func HostPort(addr net.Addr) (host string, port uint16)

HostPort returns the split host and port of a net.Addr.

func HostStr added in v0.31.6

func HostStr(addr string) string

HostStr returns the host of the address.

func NewAddr

func NewAddr(addr, network string) net.Addr

NewAddr creates a new net.Addr without format validation.

func Parse

func Parse(addr string, network string) (net.Addr, error)

Parse parses addr and constructs a net.Addr with the specified network. A 0 port is removed.

func Port

func Port(addr net.Addr) uint16

Port returns the port of net.Addr.

Types

This section is empty.

Jump to

Keyboard shortcuts

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