netutil

package
v0.0.0-...-bf55d75 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package netutil contains useful types for testing network services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PipeListener

type PipeListener struct {
	// contains filtered or unexported fields
}

PipeListener is a net.Listener that does not need permission to bind to a port or create a socket file. Useful for testing in heavily sandboxed environments or intra-process communication.

func (*PipeListener) Accept

func (l *PipeListener) Accept() (net.Conn, error)

Accept accepts a new connection on a PipeListener. Accept blocks until a new connection is made or the PipeListener is closed.

func (*PipeListener) Addr

func (l *PipeListener) Addr() net.Addr

func (*PipeListener) Close

func (l *PipeListener) Close() error

Close closes a PipeListener. The returned error will always be nil.

func (*PipeListener) Dial

func (l *PipeListener) Dial() (net.Conn, error)

Jump to

Keyboard shortcuts

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