Documentation
¶
Index ¶
- Constants
- func GetParam(r *http.Request, param ContextParam) any
- func SetParam(r *http.Request, param ContextParam, value any) *http.Request
- type ContextParam
- type ErrorFunc
- type Handler
- type LoggerFunc
- type Middleware
- type ResponseWrapper
- func (ww *ResponseWrapper) SetWriter(w io.Writer)
- func (ww *ResponseWrapper) Size() int64
- func (ww *ResponseWrapper) StartTime() time.Time
- func (ww *ResponseWrapper) Status() int
- func (ww *ResponseWrapper) Write(p []byte) (written int, err error)
- func (ww *ResponseWrapper) WriteHeader(statusCode int)
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 ¶
Types ¶
type ContextParam ¶
type ContextParam string
type LoggerFunc ¶
type LoggerFunc func(w *ResponseWrapper, r *http.Request)
type Middleware ¶
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) WriteHeader ¶
func (ww *ResponseWrapper) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.