Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrMissingHeader ¶
func ErrUnexpectedData ¶
func ErrUnexpectedHeader ¶
func ErrUnexpectedStatusCode ¶
Types ¶
type MockResponseWriter ¶
type MockResponseWriter struct { HeaderMap http.Header StatusCode int Body bytes.Buffer WriteErr bool // Force Write() calls to error. }
MockResponseWriter is a custom mock implementation of http.ResponseWriter.
func NewMockResponseWriter ¶
func NewMockResponseWriter() *MockResponseWriter
NewMockResponseWriter creates a new instance of MockResponseWriter.
func (*MockResponseWriter) Header ¶
func (rw *MockResponseWriter) Header() http.Header
Header returns the mock headers.
func (*MockResponseWriter) Write ¶
func (rw *MockResponseWriter) Write(p []byte) (int, error)
Write mocks the Write method, which writes the response body.
func (*MockResponseWriter) WriteHeader ¶
func (rw *MockResponseWriter) WriteHeader(statusCode int)
WriteHeader mocks the WriteHeader method, which sets the HTTP status code.
Click to show internal directories.
Click to hide internal directories.