Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestResponseWriter ¶
type TestResponseWriter struct {
// contains filtered or unexported fields
}
TestResponseWriter is a mock implementation of http.ResponseWriter for testing
func NewTestContext ¶
func NewTestContext(method, url string) (*http.Request, *TestResponseWriter)
NewTestContext creates a new test request and response writer for testing
func (*TestResponseWriter) Body ¶
func (w *TestResponseWriter) Body() []byte
Body returns the response body
func (*TestResponseWriter) Header ¶
func (w *TestResponseWriter) Header() http.Header
Header returns the header map for the mock response writer
func (*TestResponseWriter) StatusCode ¶
func (w *TestResponseWriter) StatusCode() int
StatusCode returns the status code that was set
func (*TestResponseWriter) Write ¶
func (w *TestResponseWriter) Write(data []byte) (int, error)
Write writes data to the mock response body
func (*TestResponseWriter) WriteHeader ¶
func (w *TestResponseWriter) WriteHeader(statusCode int)
WriteHeader sets the status code for the mock response
Click to show internal directories.
Click to hide internal directories.