response

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

type Writer struct {
	http.ResponseWriter
	Status int
}

Writer is a custom wrapper around http.ResponseWriter used in the server package. It also captures the HTTP status code and and implements the http.Flusher and http.Hijacker interfaces.

func (*Writer) Flush

func (w *Writer) Flush()

Flush method is the http.Flusher implementation of this wrapper. The Flush() method will be called if the wrapped http.ResponseWriter supports flushing.

func (*Writer) Hijack

func (w *Writer) Hijack() (net.Conn, *bufio.ReadWriter, error)

Hijack is the implementation of the http.Hijacker trying to parse the wrapped http.ResponseWriter into a http.Hijacker interface.

It returns an error if hijacking is not supported.

func (*Writer) WriteHeader

func (w *Writer) WriteHeader(statusCode int)

WriteHeader sets the status code and calls the WriteHeader() method of http.ResponseWriter.

Jump to

Keyboard shortcuts

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