types

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TextHTML               = "text/html; charset=utf-8"
	TextPlain              = "text/plain; charset=utf-8"
	ApplicationJSON        = "application/json; charset=utf-8"
	ApplicationGzip        = "application/gzip"
	ApplicationOctetStream = "application/octet-stream"
)
View Source
const (
	ContentType             = "Content-Type"
	Connection              = "Connection"
	ContentLength           = "Content-Length"
	ContentEncoding         = "Content-Encoding"
	CacheControl            = "Cache-Control"
	LastModified            = "Last-Modified"
	ETag                    = "ETag"
	IfNoneMatch             = "If-None-Match"
	IfModifiedSince         = "If-Modified-Since"
	Expires                 = "Expires"
	Age                     = "Age"
	Vary                    = "Vary"
	Date                    = "Date"
	StrictTransportSecurity = "Strict-Transport-Security"
	Authorization           = "Authorization"
	SetCookie               = "Set-Cookie"
	AcceptEncoding          = "Accept-Encoding"
	AcceptRanges            = "Accept-Ranges"
	TransferEncoding        = "Transfer-Encoding"
	XRealIP                 = "X-Real-IP"
	XForwardedFor           = "X-Forwarded-For"
	XCache                  = "X-Cache"
	XRequestId              = "X-Request-Id"
)

Variables

This section is empty.

Functions

func GetParam

func GetParam(r *http.Request, param ContextParam) any

func SetParam

func SetParam(r *http.Request, param ContextParam, value any) *http.Request

Types

type ContextParam

type ContextParam string

type ErrorFunc added in v0.2.0

type ErrorFunc func(w http.ResponseWriter, r *http.Request, status int, msg string)

type Handler

type Handler func(w http.ResponseWriter, r *http.Request) error

type LoggerFunc

type LoggerFunc func(w *ResponseWrapper, r *http.Request)

type Middleware

type Middleware func(next Handler) Handler

type ResponseWrapper

type ResponseWrapper struct {
	http.ResponseWriter

	BeforeBody func()
	// contains filtered or unexported fields
}

func NewResponseWrapper

func NewResponseWrapper(w http.ResponseWriter) *ResponseWrapper

func (*ResponseWrapper) SetWriter

func (ww *ResponseWrapper) SetWriter(w io.Writer)

func (*ResponseWrapper) Size

func (ww *ResponseWrapper) Size() int64

func (*ResponseWrapper) StartTime

func (ww *ResponseWrapper) StartTime() time.Time

func (*ResponseWrapper) Status

func (ww *ResponseWrapper) Status() int

func (*ResponseWrapper) Write

func (ww *ResponseWrapper) Write(p []byte) (written int, err error)

func (*ResponseWrapper) WriteHeader

func (ww *ResponseWrapper) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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