web

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHijackNotImplemented = errors.New("hijack not implemented")
View Source
var ErrPushNotImplemented = errors.New("push not implemented")

Functions

This section is empty.

Types

type ResponseWriterWrapper

type ResponseWriterWrapper struct {
	http.ResponseWriter
	StatusCode    int
	ContentLength int
}

func NewResponseWriterWrapper

func NewResponseWriterWrapper(w http.ResponseWriter) *ResponseWriterWrapper

func (*ResponseWriterWrapper) Flush

func (rww *ResponseWriterWrapper) Flush()

Flush implements http.Flusher. It simply calls the underlying ResponseWriter's Flush method if there is one.

func (*ResponseWriterWrapper) Hijack

func (rww *ResponseWriterWrapper) Hijack() (net.Conn, *bufio.ReadWriter, error)

Hijack implements http.Hijacker. It simply calls the underlying ResponseWriter's Hijack method if there is one, or returns ErrNotImplemented otherwise.

func (*ResponseWriterWrapper) Push

func (rww *ResponseWriterWrapper) Push(target string, opts *http.PushOptions) error

Push implements http.Pusher. It simply calls the underlying ResponseWriter's Push method if there is one, or returns ErrNotImplemented otherwise.

func (*ResponseWriterWrapper) ReadFrom

func (rww *ResponseWriterWrapper) ReadFrom(r io.Reader) (n int64, err error)

ReadFrom implements io.ReaderFrom. It simply calls the underlying ResponseWriter's ReadFrom method if there is one, otherwise it defaults to io.Copy.

func (*ResponseWriterWrapper) Unwrap

Unwrap returns the underlying ResponseWriter.

func (*ResponseWriterWrapper) Write

func (rww *ResponseWriterWrapper) Write(b []byte) (int, error)

Write computes the written len and stores it in ContentLength.

func (*ResponseWriterWrapper) WriteHeader

func (rww *ResponseWriterWrapper) WriteHeader(code int)

WriteHeader records the value of the status code before writing it.

Directories

Path Synopsis
Package alice provides a convenient way to chain http handlers.
Package alice provides a convenient way to chain http handlers.

Jump to

Keyboard shortcuts

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