Documentation
¶
Index ¶
- Constants
- func Attachment(w http.ResponseWriter, r io.Reader, code int, params map[string]string) error
- func Cors(w http.ResponseWriter, r *http.Request, origin string, methods ...string)
- func Empty(w http.ResponseWriter, code int) error
- func Error(w http.ResponseWriter, err error, detail ...any) error
- func JSON(w http.ResponseWriter, code, indent int, v any) error
- type Err
Constants ¶
View Source
const ( ErrBadRequest = Err(http.StatusBadRequest) ErrNotFound = Err(http.StatusNotFound) ErrConflict = Err(http.StatusConflict) ErrNotImplemented = Err(http.StatusNotImplemented) ErrInternalError = Err(http.StatusInternalServerError) )
Variables ¶
This section is empty.
Functions ¶
func Attachment ¶ added in v1.5.0
Attachment will write out an attachment from a io.Reader
func Empty ¶
func Empty(w http.ResponseWriter, code int) error
Empty is a utility function to serve an empty response
Types ¶
Click to show internal directories.
Click to hide internal directories.