net

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package net provides generic network helpers and proxies to some useful standard types and functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinAllHostPorts

func JoinAllHostPorts(addresses []string, ports []uint16) ([]string, error)

JoinAllHostPorts combines a list of addresses and a list of ports, validating the provided IP addresses or name in the process

func JoinHostPort

func JoinHostPort(host string, port uint16) (string, error)

JoinHostPort combines a given host address and a port, validating the provided IP address or name in the process

func SplitHostPort

func SplitHostPort(hostport string) (string, uint16, error)

SplitHostPort splits a network address into host and port, validating the host and port in the process

Types

type Addr

type Addr = net.Addr

Addr is an alias of the standard net.Addr type

type Conn

type Conn = net.Conn

Conn is an alias of the standard net.Conn type

type Dialer added in v0.2.0

type Dialer interface {
	DialContext(ctx context.Context, network string, address string) (net.Conn, error)
}

Dialer establishes a TCP connection to a remote.

type IP

type IP = net.IP

IP is an alias of the standard net.IP type

type Listener

type Listener = net.Listener

Listener is an alias of the standard net.Listener type

type TCPAddr added in v0.2.4

type TCPAddr = net.TCPAddr

TCPAddr is an alias of the standard net.TCPAddr type

type TCPConn added in v0.2.4

type TCPConn = net.TCPConn

TCPConn is an alias of the standard net.TCPConn type

type TCPListener added in v0.2.4

type TCPListener = net.TCPListener

TCPListener is an alias of the standard net.TCPListener type

Directories

Path Synopsis
Package bind provides mechanisms to facilitate listening TCP and UDP ports
Package bind provides mechanisms to facilitate listening TCP and UDP ports
Package reconnect implement a generic retrying TCP client
Package reconnect implement a generic retrying TCP client

Jump to

Keyboard shortcuts

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