Documentation
¶
Index ¶
- func NotFoundHandler() http.Handler
- func TokenFromHeader(r *http.Request) string
- func WriteBadRequest(w http.ResponseWriter, details any)
- func WriteCreated(w http.ResponseWriter, data, meta any)
- func WriteInternalError(w http.ResponseWriter, details any)
- func WriteNoContent(w http.ResponseWriter)
- func WriteNotFound(w http.ResponseWriter, details any)
- func WriteOK(w http.ResponseWriter, data, meta any)
- func WriteResponse(w http.ResponseWriter, code int, body any)
- func WriteUnauthorized(w http.ResponseWriter, details any)
- func WriteValidationError(w http.ResponseWriter, err error)
- type DataResponse
- type ErrorResponse
- type ErrorResponseError
- type SPAHandler
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NotFoundHandler ¶ added in v1.0.20
func TokenFromHeader ¶ added in v1.0.22
func WriteBadRequest ¶
func WriteBadRequest(w http.ResponseWriter, details any)
func WriteCreated ¶
func WriteCreated(w http.ResponseWriter, data, meta any)
func WriteInternalError ¶
func WriteInternalError(w http.ResponseWriter, details any)
func WriteNoContent ¶
func WriteNoContent(w http.ResponseWriter)
func WriteNotFound ¶
func WriteNotFound(w http.ResponseWriter, details any)
func WriteOK ¶
func WriteOK(w http.ResponseWriter, data, meta any)
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, code int, body any)
func WriteUnauthorized ¶
func WriteUnauthorized(w http.ResponseWriter, details any)
func WriteValidationError ¶ added in v1.0.10
func WriteValidationError(w http.ResponseWriter, err error)
Types ¶
type DataResponse ¶
func NewDataResponse ¶
func NewDataResponse(data, meta any) *DataResponse
type ErrorResponse ¶
type ErrorResponse struct {
Error ErrorResponseError `json:"error"`
}
func NewErrorResponse ¶
func NewErrorResponse(code string, details any) *ErrorResponse
type ErrorResponseError ¶
type SPAHandler ¶ added in v1.0.21
type SPAHandler struct {
// contains filtered or unexported fields
}
func NewSPAHandler ¶ added in v1.0.21
func (*SPAHandler) ServeHTTP ¶ added in v1.0.21
func (h *SPAHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ValidationError ¶
func (ValidationError) Error ¶
func (err ValidationError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.