Documentation
¶
Overview ¶
Package fakehttp provides a fake HTTP server for tests that have dependencies using HTTP clients.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeResponse ¶
DecodeResponse decodes the HTTP Response.Body JSON.
func DefaultHandler ¶
DefaultHandler is a default HTTP request handler that returns a nil body.
Types ¶
type HTTP ¶
type HTTP struct { // Handler is handler for HTTP requests. Handler Handler // Server is the HTTP server. Uses handler for handling requests. Server *httptest.Server // Client is the HTTP client connected to the HTTP server. Client *http.Client }
HTTP provides an HTTP server routing calls to its handler and a client connected to it.
type PrefixHandlers ¶
PrefixHandlers demuxes calls based on URL path prefix. The first handler whose prefix matches will be called.
Click to show internal directories.
Click to hide internal directories.