Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HTTPResponse ¶
type HTTPResponse struct { http.Response // Buffer is the file underlying Body. Buffer bytes.Buffer }
HTTPResponse is an HTTP response for use in testing.
func NewErrorResponse ¶
func NewErrorResponse(statusCode int, msg string) *HTTPResponse
NewErrorResponse returns an HTTP response with the status and body set to the provided values.
func NewFailureResponse ¶
func NewFailureResponse(failure *params.Error) *HTTPResponse
NewFailureResponse returns an HTTP response with the status set to 500 (Internal Server Error) and the body set to the JSON-encoded error.
func NewHTTPResponse ¶
func NewHTTPResponse() *HTTPResponse
NewHTTPResponse returns an HTTP response with an OK status, no headers set, and an empty body.
Click to show internal directories.
Click to hide internal directories.