writer

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecureCookiesStrip = "strip"
	SecureCookieAV     = "Secure"
)
View Source
const (
	AcceptEncodingHeader  = "Accept-Encoding"
	ContentEncodingHeader = "Content-Encoding"
	ContentLengthHeader   = "Content-Length"
	GzipName              = "gzip"
	VaryHeader            = "Vary"
)

Variables

This section is empty.

Functions

func ModifyAcceptEncoding

func ModifyAcceptEncoding(header http.Header)

Types

type Gzip

type Gzip struct {
	// contains filtered or unexported fields
}

func NewGzipWriter

func NewGzipWriter(rw http.ResponseWriter, header http.Header) *Gzip

func (*Gzip) Close

func (g *Gzip) Close() (err error)

func (*Gzip) Flush

func (g *Gzip) Flush()

func (*Gzip) Header

func (g *Gzip) Header() http.Header

func (*Gzip) Hijack

func (g *Gzip) Hijack() (net.Conn, *bufio.ReadWriter, error)

func (*Gzip) Write

func (g *Gzip) Write(p []byte) (n int, err error)

Write fills a small buffer first to determine if a compression is required or not.

func (*Gzip) WriteHeader

func (g *Gzip) WriteHeader(statusCode int)

type HeaderModifier

type HeaderModifier func(header http.Header)

type Response

type Response struct {
	// contains filtered or unexported fields
}

Response wraps the http.ResponseWriter.

func NewResponseWriter

func NewResponseWriter(rw http.ResponseWriter, secureCookies string) *Response

NewResponseWriter creates a new ResponseWriter. It wraps the http.ResponseWriter.

func (*Response) AddHeaderModifier

func (r *Response) AddHeaderModifier(headerModifier HeaderModifier)

func (*Response) AddModifier

func (r *Response) AddModifier(modifier ...hcl.Body)

func (*Response) AddPrivateCC

func (r *Response) AddPrivateCC()

func (*Response) Flush

func (r *Response) Flush()

Flush implements the <http.Flusher> interface.

func (*Response) Header

func (r *Response) Header() http.Header

Header wraps the Header method of the <http.ResponseWriter>.

func (*Response) Hijack

func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error)

func (*Response) IsHijacked

func (r *Response) IsHijacked() bool

func (*Response) StatusCode

func (r *Response) StatusCode() int

func (*Response) WithEvalContext

func (r *Response) WithEvalContext(ctx *eval.Context) *Response

WithEvalContext sets the eval context for the response modifiers.

func (*Response) Write

func (r *Response) Write(p []byte) (int, error)

Write wraps the Write method of the <http.ResponseWriter>.

func (*Response) WriteHeader

func (r *Response) WriteHeader(statusCode int)

WriteHeader wraps the WriteHeader method of the <http.ResponseWriter>.

func (*Response) WrittenBytes

func (r *Response) WrittenBytes() int

Jump to

Keyboard shortcuts

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