netpipetestserver

package
v2.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package netpipetestserver provides httptest.Server and http.Client pairs configured to work within a synctest bubble by swapping the network for a pair of in-memory net.Pipe connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(t testing.TB, client *http.Client) (net.Conn, error)

Dial allows tests using netPipeListener to directly access the underlying client connection via the http.Client's transport. The client must be one created by New.

func New

func New(t *testing.T, handler http.Handler) (*httptest.Server, *http.Client)

New creates a new httptest.Server and http.Client pair suitable for use within a synctest bubble, which can't span real network connections. The server and client communicate over a pair of in-memory net.Pipe connections.

Types

This section is empty.

Jump to

Keyboard shortcuts

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