response

package
v0.4.2-gz6 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 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 WithCodeResponseWriter

type WithCodeResponseWriter struct {
	Writer http.ResponseWriter
	Code   int
}

A WithCodeResponseWriter is a helper to delay sealing a http.ResponseWriter on writing code.

func NewWithCodeResponseWriter

func NewWithCodeResponseWriter(writer http.ResponseWriter) *WithCodeResponseWriter

NewWithCodeResponseWriter returns a WithCodeResponseWriter. If writer is already a WithCodeResponseWriter, it returns writer directly.

func (*WithCodeResponseWriter) Flush

func (w *WithCodeResponseWriter) Flush()

Flush flushes the response writer.

func (*WithCodeResponseWriter) Header

func (w *WithCodeResponseWriter) Header() http.Header

Header returns the http header.

func (*WithCodeResponseWriter) Hijack

Hijack implements the http.Hijacker interface. This expands the Response to fulfill http.Hijacker if the underlying http.ResponseWriter supports it.

func (*WithCodeResponseWriter) Write

func (w *WithCodeResponseWriter) Write(bytes []byte) (int, error)

Write writes bytes into w.

func (*WithCodeResponseWriter) WriteHeader

func (w *WithCodeResponseWriter) WriteHeader(code int)

WriteHeader writes code into w, and not sealing the writer.

Jump to

Keyboard shortcuts

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