Documentation ¶
Index ¶
- Variables
- type ResponseWriterWrapper
- func (rww *ResponseWriterWrapper) Flush()
- func (rww *ResponseWriterWrapper) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (rww *ResponseWriterWrapper) Push(target string, opts *http.PushOptions) error
- func (rww *ResponseWriterWrapper) ReadFrom(r io.Reader) (n int64, err error)
- func (rww *ResponseWriterWrapper) Unwrap() http.ResponseWriter
- func (rww *ResponseWriterWrapper) Write(b []byte) (int, error)
- func (rww *ResponseWriterWrapper) WriteHeader(code int)
Constants ¶
This section is empty.
Variables ¶
var ErrHijackNotImplemented = errors.New("hijack not implemented")
var ErrPushNotImplemented = errors.New("push not implemented")
Functions ¶
This section is empty.
Types ¶
type ResponseWriterWrapper ¶
type ResponseWriterWrapper struct { http.ResponseWriter StatusCode int ContentLength int }
func NewResponseWriterWrapper ¶
func NewResponseWriterWrapper(w http.ResponseWriter) *ResponseWriterWrapper
func (*ResponseWriterWrapper) Flush ¶
func (rww *ResponseWriterWrapper) Flush()
Flush implements http.Flusher. It simply calls the underlying ResponseWriter's Flush method if there is one.
func (*ResponseWriterWrapper) Hijack ¶
func (rww *ResponseWriterWrapper) Hijack() (net.Conn, *bufio.ReadWriter, error)
Hijack implements http.Hijacker. It simply calls the underlying ResponseWriter's Hijack method if there is one, or returns ErrNotImplemented otherwise.
func (*ResponseWriterWrapper) Push ¶
func (rww *ResponseWriterWrapper) Push(target string, opts *http.PushOptions) error
Push implements http.Pusher. It simply calls the underlying ResponseWriter's Push method if there is one, or returns ErrNotImplemented otherwise.
func (*ResponseWriterWrapper) ReadFrom ¶
func (rww *ResponseWriterWrapper) ReadFrom(r io.Reader) (n int64, err error)
ReadFrom implements io.ReaderFrom. It simply calls the underlying ResponseWriter's ReadFrom method if there is one, otherwise it defaults to io.Copy.
func (*ResponseWriterWrapper) Unwrap ¶
func (rww *ResponseWriterWrapper) Unwrap() http.ResponseWriter
Unwrap returns the underlying ResponseWriter.
func (*ResponseWriterWrapper) Write ¶
func (rww *ResponseWriterWrapper) Write(b []byte) (int, error)
Write computes the written len and stores it in ContentLength.
func (*ResponseWriterWrapper) WriteHeader ¶
func (rww *ResponseWriterWrapper) WriteHeader(code int)
WriteHeader records the value of the status code before writing it.
Directories ¶
Path | Synopsis |
---|---|
Package alice provides a convenient way to chain http handlers.
|
Package alice provides a convenient way to chain http handlers. |