Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WithCodeResponseWriter ¶
type WithCodeResponseWriter struct { Writer http.ResponseWriter Code int }
A WithCodeResponseWriter is a helper to delay sealing a http.ResponseWriter on writing code.
func NewWithCodeResponseWriter ¶
func NewWithCodeResponseWriter(writer http.ResponseWriter) *WithCodeResponseWriter
NewWithCodeResponseWriter returns a WithCodeResponseWriter. If writer is already a WithCodeResponseWriter, it returns writer directly.
func (*WithCodeResponseWriter) Flush ¶
func (w *WithCodeResponseWriter) Flush()
Flush flushes the response writer.
func (*WithCodeResponseWriter) Header ¶
func (w *WithCodeResponseWriter) Header() http.Header
Header returns the http header.
func (*WithCodeResponseWriter) Hijack ¶
func (w *WithCodeResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
Hijack implements the http.Hijacker interface. This expands the Response to fulfill http.Hijacker if the underlying http.ResponseWriter supports it.
func (*WithCodeResponseWriter) Write ¶
func (w *WithCodeResponseWriter) Write(bytes []byte) (int, error)
Write writes bytes into w.
func (*WithCodeResponseWriter) WriteHeader ¶
func (w *WithCodeResponseWriter) WriteHeader(code int)
WriteHeader writes code into w, and not sealing the writer.
Click to show internal directories.
Click to hide internal directories.