# Functions
BrokenConnectionHandler creates an HTTP handler that will simulate an I/O error.
ChunkedStreamingHandler creates an HTTP handler that streams arbitrary data using chunked encoding.
ClientFromHandler returns an http.Client that does not do real network activity, but instead delegates to a http.Handler as if that handler were being used by a server.
HandlerForMethod is a simple alternative to using an HTTP router.
HandlerForPath is a simple alternative to using an HTTP router.
HandlerForPathRegex is a simple alternative to using an HTTP router.
HandlerWithJSONResponse creates an HTTP handler that returns a 200 status and the JSON encoding of the specified object.
HandlerWithResponse creates an HTTP handler that always returns the same status code, headers, and body.
HandlerWithStatus creates an HTTP handler that always returns the same status code.
MakeSelfSignedCert generates a self-signed certificate and writes it to the specified files.
MakeServerWithCert creates and starts a test HTTPS server using the specified certificate.
RecordingHandler wraps any HTTP handler in another handler that pushes received requests onto a channel.
SequentialHandler creates an HTTP handler that delegates to one handler per request, in the order given.
SSEHandler creates an HTTP handler that streams Server-Sent Events data.
WithSelfSignedServer is a convenience function for starting a test HTTPS server with a self-signed certificate, running the specified function, and then closing the server and cleaning up the temporary certificate files.
WithServer creates an httptest.Server from the given handler, passes the server instance to the given function, and ensures that the server is closed afterward.
# Structs
DelegatingHandler is a struct that behaves as an http.Handler by delegating to the handler it wraps.
HTTPRequestInfo represents a request captured by NewRecordingHTTPHandler.
SSEEvent is a simple representation of a Server-Sent Events message.
# Interfaces
SSEStreamControl is the interface for manipulating streams created by SSEHandler.
StreamControl is the interface for manipulating streams created by ChunkedStreamingHandler.