Documentation ¶
Index ¶
- func WriteBadRequest(resp http.ResponseWriter, req *http.Request, msg ...string)
- func WriteJSONErrorPage(resp http.ResponseWriter, code int, message string)
- func WriteJSONResponse(resp http.ResponseWriter, code int, data interface{})
- func WriteNoContent(resp http.ResponseWriter)
- func WriteNotFound(resp http.ResponseWriter)
- type RequestLogger
- type ResponseRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteBadRequest ¶
func WriteBadRequest(resp http.ResponseWriter, req *http.Request, msg ...string)
func WriteJSONErrorPage ¶
func WriteJSONErrorPage(resp http.ResponseWriter, code int, message string)
func WriteJSONResponse ¶
func WriteJSONResponse(resp http.ResponseWriter, code int, data interface{})
func WriteNoContent ¶
func WriteNoContent(resp http.ResponseWriter)
func WriteNotFound ¶
func WriteNotFound(resp http.ResponseWriter)
Types ¶
type RequestLogger ¶
func (*RequestLogger) ServeHTTP ¶
func (l *RequestLogger) ServeHTTP(resp http.ResponseWriter, req *http.Request)
type ResponseRecorder ¶
type ResponseRecorder struct { http.ResponseWriter StatusCode int BytesWritten int64 }
func (*ResponseRecorder) Write ¶
func (e *ResponseRecorder) Write(b []byte) (int, error)
Write sums the writes to produce the actual number of bytes written
func (*ResponseRecorder) WriteHeader ¶
func (e *ResponseRecorder) WriteHeader(code int)
WriteHeader captures the status code and writes through to the wrapper ResponseWriter.
Click to show internal directories.
Click to hide internal directories.