httpwriter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package httpwriter resolves optional net/http response-writer capabilities through bounded Unwrap chains.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHijackerUnavailable = errors.New("httpwriter: http.Hijacker is unavailable")
	ErrNilWriter           = errors.New("httpwriter: response writer is nil")
	ErrNilUnwrap           = errors.New("httpwriter: Unwrap returned nil")
	ErrUnwrapCycle         = errors.New("httpwriter: Unwrap cycle detected")
	ErrUnwrapDepth         = errors.New("httpwriter: Unwrap depth exceeded")
)

Hijacker resolution errors are internal capability diagnostics. Callers can use errors.Is to distinguish an unsupported writer from a malformed chain.

Functions

func Hijack

Hijack resolves and invokes the effective http.Hijacker behind w.

func ResolveHijacker

func ResolveHijacker(w http.ResponseWriter) (http.Hijacker, error)

ResolveHijacker finds the effective http.Hijacker behind w.

Unwrap takes precedence over a forwarding Hijack method on the same dynamic writer. This prevents a wrapper from advertising Hijacker when its effective underlying writer cannot actually support it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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