Documentation
¶
Index ¶
- func BuildPaginationResponse(p pagination.Pagination) models.Pagination
- func DecodeJSON[T any](r *http.Request) (*T, error)
- func HTTPStatusCodeFromErr(err error) int
- func MustDecodeJSON[T any](w http.ResponseWriter, r *http.Request) (*T, bool)
- func WriteError(w http.ResponseWriter, status int, msg string)
- func WriteJSON(w http.ResponseWriter, status int, v any)
- type ErrorPresenter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPaginationResponse ¶
func BuildPaginationResponse(p pagination.Pagination) models.Pagination
func HTTPStatusCodeFromErr ¶
func MustDecodeJSON ¶
func WriteError ¶
func WriteError(w http.ResponseWriter, status int, msg string)
Types ¶
type ErrorPresenter ¶
type ErrorPresenter struct {
Writer http.ResponseWriter
}
func (ErrorPresenter) Error ¶
func (p ErrorPresenter) Error(err error)
Click to show internal directories.
Click to hide internal directories.