Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler is the interface used by httpmock instead of http.Handler so that it can be mocked very easily.
type MockHandler ¶
MockHandler is a test.Handler that uses github.com/stretchr/testify/mock.
type Response ¶
type Response struct { // The HTTP status code to write (default: 200) Status int // Headers to add to the response Header http.Header // The response body to write (default: no body) Body []byte }
Response holds the response a handler wants to return to the client.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server listens for requests and interprets them into calls to your Handler.
func NewServer ¶
NewServer constructs a new server and starts it (compare to httptest.NewServer). It needs to be Closed()ed.
func NewUnstartedServer ¶
NewUnstartedServer constructs a new server but doesn't start it (compare to httptest.NewUnstartedServer).
Click to show internal directories.
Click to hide internal directories.