libnet

package
v0.0.0-...-82d97ee Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 7 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StripPort

func StripPort(addr string) (string, string, error)

StripPort takes an address like "example.com:8080", "127.0.0.1", "[2001:db8::1]:443", or even "example.com" (no port), and returns:

host (string), port (string), err (error)

Types

type Conn

type Conn interface {
	io.Reader
	io.Writer
	io.Closer
}

type Dialer

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

type Listener

type Listener interface {
	Listen(ctx context.Context, address string) (net.Listener, error)
}

type Network

type Network interface {
	Listener
	Dialer
	String() string
}

type TCPNet

type TCPNet struct{}

func (TCPNet) Dial

func (TCPNet) Dial(ctx context.Context, address string) (net.Conn, error)

func (TCPNet) Listen

func (TCPNet) Listen(ctx context.Context, address string) (net.Listener, error)

func (TCPNet) String

func (TCPNet) String() string

type TCPReuseNet

type TCPReuseNet struct{}

func (TCPReuseNet) Dial

func (TCPReuseNet) Dial(ctx context.Context, address string) (net.Conn, error)

func (TCPReuseNet) Listen

func (TCPReuseNet) Listen(ctx context.Context, address string) (net.Listener, error)

func (TCPReuseNet) String

func (TCPReuseNet) String() string

Jump to

Keyboard shortcuts

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