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.
Click to show internal directories.
Click to hide internal directories.