nettest

package
v0.24.49 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package nettest provides types and functions to test net related functionality.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrListenerClosed = errors.New("failed to listen, closed")
)

Functions

This section is empty.

Types

type SlowAcceptListener

type SlowAcceptListener struct {
	Network string
	Address string
	// contains filtered or unexported fields
}

func NewSlowAcceptListener

func NewSlowAcceptListener(opt *SlowAcceptListenerOptions) (*SlowAcceptListener, error)

func (*SlowAcceptListener) Accept

func (lo *SlowAcceptListener) Accept() (net.Conn, error)

func (*SlowAcceptListener) Addr

func (lo *SlowAcceptListener) Addr() net.Addr

func (*SlowAcceptListener) Close

func (lo *SlowAcceptListener) Close() error

func (*SlowAcceptListener) Delay

func (lo *SlowAcceptListener) Delay(d time.Duration)

type SlowAcceptListenerOptions

type SlowAcceptListenerOptions struct {
	Network string
	Address string
	Delay   time.Duration
}

Jump to

Keyboard shortcuts

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