Versions in this module Expand all Collapse all v0 v0.8.2 Feb 7, 2025 v0.8.1 Feb 5, 2025 v0.8.0 Jan 19, 2025 Changes in this version + const ExportTypeCSV + const HeaderAccept + const HeaderAcceptEncoding + const HeaderAccessControlAllowCredentials + const HeaderAccessControlAllowHeaders + const HeaderAccessControlAllowMethods + const HeaderAccessControlAllowOrigin + const HeaderAccessControlExposeHeaders + const HeaderAccessControlMaxAge + const HeaderAccessControlRequestHeaders + const HeaderAccessControlRequestMethod + const HeaderAllow + const HeaderAuthorization + const HeaderCacheControl + const HeaderConnection + const HeaderContentDisposition + const HeaderContentEncoding + const HeaderContentLength + const HeaderContentSecurityPolicy + const HeaderContentSecurityPolicyReportOnly + const HeaderContentType + const HeaderCookie + const HeaderIfModifiedSince + const HeaderLastModified + const HeaderLocation + const HeaderOrigin + const HeaderReferrerPolicy + const HeaderRetryAfter + const HeaderServer + const HeaderSetCookie + const HeaderStrictTransportSecurity + const HeaderUpgrade + const HeaderVary + const HeaderWWWAuthenticate + const HeaderXCSRFToken + const HeaderXContentTypeOptions + const HeaderXCorrelationID + const HeaderXForwardedFor + const HeaderXForwardedProto + const HeaderXForwardedProtocol + const HeaderXForwardedSsl + const HeaderXFrameOptions + const HeaderXHTTPMethodOverride + const HeaderXRealIP + const HeaderXRequestID + const HeaderXRequestedWith + const HeaderXUrlScheme + const HeaderXXSSProtection + const MIMEApplicationForm + const MIMEApplicationJSON + const MIMEApplicationJSONCharsetUTF8 + const MIMEApplicationJavaScript + const MIMEApplicationJavaScriptCharsetUTF8 + const MIMEApplicationMsgpack + const MIMEApplicationProtobuf + const MIMEApplicationXML + const MIMEApplicationXMLCharsetUTF8 + const MIMEMultipartForm + const MIMEOctetStream + const MIMETextHTML + const MIMETextHTMLCharsetUTF8 + const MIMETextPlain + const MIMETextPlainCharsetUTF8 + const MIMETextXML + const MIMETextXMLCharsetUTF8 + var ErrInvalidRedirectCode = errors.New("invalid redirect code") + func Blob(w http.ResponseWriter, code int, contentType string, b []byte) error + func CommaQueryParam(v []string) []string + func Decode(r *http.Request, v interface{}) error + func DecodeForm(r io.Reader, v interface{}) error + func DecodeJSON(r io.Reader, v interface{}) error + func DecodeXML(r io.Reader, v interface{}) error + func GetCookie(r *http.Request, cookieName string) (*http.Cookie, error) + func HandleError(w http.ResponseWriter, resp ErrorCode) + func IsWebSocket(r *http.Request) bool + func JSON(w http.ResponseWriter, code int, data interface{}) error + func JSONBlob(w http.ResponseWriter, code int, data []byte) error + func JSONPretty(w http.ResponseWriter, code int, data interface{}, indent string) error + func NewMiddlewareHandler(handlers []func(next http.Handler) http.Handler) http.Handler + func NoContent(w http.ResponseWriter, code int) error + func OffsetLimit(r *http.Request) (offset, limit int64) + func QueryParam(r *http.Request, key string) string + func RealIP(r *http.Request) string + func Redirect(w http.ResponseWriter, code int, url string) error + func RemoveCookie(w http.ResponseWriter, cookieName string, v CookieConfig) + func RewriteRequestURLTarget(req *http.Request, target *url.URL) + func Scheme(r *http.Request) string + func SetCookie(w http.ResponseWriter, value string, cookieName string, v CookieConfig) + func SetCookieB64(w http.ResponseWriter, body []byte, cookieName string, v CookieConfig) string + type ContentType int + const ContentTypeEventStream + const ContentTypeForm + const ContentTypeHTML + const ContentTypeJSON + const ContentTypePlainText + const ContentTypeUnknown + const ContentTypeXML + func GetRequestContentType(r *http.Request) ContentType + type CookieConfig struct + Domain string + HttpOnly bool + MaxAge int + Path string + SameSite http.SameSite + Secure bool + type Error struct + Code int + Err error + Msg string + func NewError(message string, err error, code int) Error + func NewErrorAs(err error) Error + func (e Error) Error() string + func (e Error) GetCode() int + func (e Error) MarshalJSON() ([]byte, error) + type ErrorCode interface + GetCode func() int + type Export struct + Type exportType + func NewExport(t exportType) Export + func (e Export) ExportHTTP(w http.ResponseWriter, headers []string, data []map[string]any, ...) error + type Response struct + Msg string