responsewriter

package
v0.20.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package responsewriter provides utilities for wrapping http.ResponseWriter while preserving optional interfaces like Hijacker, Flusher, and ReaderFrom.

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL