httpclienttest

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package httpclienttest builds httpclient.Client values for tests against an httptest TLS server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(tb testing.TB, srv *httptest.Server, cfg httpclient.Config) *httpclient.Client

NewClient returns a client built from cfg that trusts and allows the TLS server srv only, with one attempt per call.

func Stall added in v0.24.0

func Stall(_ http.ResponseWriter, r *http.Request)

Stall is a handler that never answers: it waits for the request to end, then aborts the connection. Returning instead would send an empty 200, which the client can still read while it closes the connection on its own timeout (net/http Transport keeps a response that races the close).

Types

This section is empty.

Jump to

Keyboard shortcuts

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