Documentation
¶
Overview ¶
Package responsewriter provides utilities for wrapping http.ResponseWriter while preserving optional interfaces like Hijacker, Flusher, and ReaderFrom.
Index ¶
- type Wrapper
- type WrapperBase
- func (w *WrapperBase) CloseNotify() <-chan bool
- func (w *WrapperBase) Flush()
- func (w *WrapperBase) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (w *WrapperBase) Push(target string, opts *http.PushOptions) error
- func (w *WrapperBase) ReadFrom(r io.Reader) (n int64, err error)
- func (w *WrapperBase) Unwrap() http.ResponseWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Wrapper ¶
type Wrapper interface {
http.ResponseWriter
// Unwrap returns the original ResponseWriter
Unwrap() http.ResponseWriter
}
Wrapper is an interface that all ResponseWriter wrappers should implement
type WrapperBase ¶
type WrapperBase struct {
http.ResponseWriter
}
WrapperBase provides a base implementation for ResponseWriter wrappers that preserves optional interfaces (Hijacker, Flusher, ReaderFrom)
func (*WrapperBase) CloseNotify ¶
func (w *WrapperBase) CloseNotify() <-chan bool
CloseNotify implements the deprecated http.CloseNotifier interface if the underlying ResponseWriter supports it Deprecated: Use Request.Context() instead
func (*WrapperBase) Flush ¶
func (w *WrapperBase) Flush()
Flush implements http.Flusher interface if the underlying ResponseWriter supports it
func (*WrapperBase) Hijack ¶
func (w *WrapperBase) Hijack() (net.Conn, *bufio.ReadWriter, error)
Hijack implements http.Hijacker interface if the underlying ResponseWriter supports it
func (*WrapperBase) Push ¶
func (w *WrapperBase) Push(target string, opts *http.PushOptions) error
Push implements http.Pusher interface if the underlying ResponseWriter supports it
func (*WrapperBase) ReadFrom ¶
func (w *WrapperBase) ReadFrom(r io.Reader) (n int64, err error)
ReadFrom implements io.ReaderFrom interface if the underlying ResponseWriter supports it
func (*WrapperBase) Unwrap ¶
func (w *WrapperBase) Unwrap() http.ResponseWriter
Unwrap returns the original ResponseWriter