Documentation
¶
Index ¶
- func GetHeader(r *http.Request, key string) string
- func GetHeaderOr(r *http.Request, key string, defaultValue string) string
- func GetQueryBool(r *http.Request, key string) (bool, error)
- func GetQueryBoolOr(r *http.Request, key string, defaultValue bool) bool
- func GetQueryInt(r *http.Request, key string) (int, error)
- func GetQueryIntOr(r *http.Request, key string, defaultValue int) int
- func GetQueryParam(r *http.Request, key string) string
- func GetQueryParamOr(r *http.Request, key string, defaultValue string) string
- func HTML(w http.ResponseWriter, content string) error
- func IsDelete(r *http.Request) bool
- func IsGet(r *http.Request) bool
- func IsPatch(r *http.Request) bool
- func IsPost(r *http.Request) bool
- func IsPut(r *http.Request) bool
- func JSON(w http.ResponseWriter, value any) error
- func JSONBadRequest(w http.ResponseWriter, message string) error
- func JSONCreated(w http.ResponseWriter, value any) error
- func JSONError(w http.ResponseWriter, message string, status int) error
- func JSONForbidden(w http.ResponseWriter, message string) error
- func JSONInternalError(w http.ResponseWriter, message string) error
- func JSONNotFound(w http.ResponseWriter, message string) error
- func JSONStatus(w http.ResponseWriter, value any, status int) error
- func JSONUnauthorized(w http.ResponseWriter, message string) error
- func MethodNotAllowed(w http.ResponseWriter, allowed ...string)
- func NoContent(w http.ResponseWriter)
- func ReadJSON(r *http.Request, target any) error
- func ReadJSONAndClose(r *http.Request, target any) error
- func ReadJSONLimit(r *http.Request, maxBytes int64, target any) error
- func Redirect(w http.ResponseWriter, r *http.Request, url string)
- func RedirectPermanent(w http.ResponseWriter, r *http.Request, url string)
- func SafeHTML(w http.ResponseWriter, content string) error
- func SafeRedirect(w http.ResponseWriter, r *http.Request, redirectURL string, ...) error
- func SafeURL(tmpl string, pathParams map[string]string, queryParams map[string]string) (string, error)
- func SecureHeaders(handler http.Handler) http.Handler
- func Serve(addr string, handler http.Handler) error
- func SetSecureHeaders(w http.ResponseWriter)
- func Text(w http.ResponseWriter, content string) error
- func TextStatus(w http.ResponseWriter, content string, status int) error
- func WithCSRF(handler http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetQueryParamOr ¶
func JSONBadRequest ¶
func JSONBadRequest(w http.ResponseWriter, message string) error
func JSONCreated ¶
func JSONCreated(w http.ResponseWriter, value any) error
func JSONForbidden ¶
func JSONForbidden(w http.ResponseWriter, message string) error
func JSONInternalError ¶
func JSONInternalError(w http.ResponseWriter, message string) error
func JSONNotFound ¶
func JSONNotFound(w http.ResponseWriter, message string) error
func JSONStatus ¶
func JSONStatus(w http.ResponseWriter, value any, status int) error
func JSONUnauthorized ¶
func JSONUnauthorized(w http.ResponseWriter, message string) error
func MethodNotAllowed ¶
func MethodNotAllowed(w http.ResponseWriter, allowed ...string)
func NoContent ¶
func NoContent(w http.ResponseWriter)
func ReadJSONLimit ¶ added in v0.0.8
func RedirectPermanent ¶
func RedirectPermanent(w http.ResponseWriter, r *http.Request, url string)
func SafeRedirect ¶ added in v0.0.8
func SetSecureHeaders ¶ added in v0.0.8
func SetSecureHeaders(w http.ResponseWriter)
func TextStatus ¶
func TextStatus(w http.ResponseWriter, content string, status int) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.