Documentation ¶
Index ¶
- Variables
- func AuthenticationRequiredResponse(w http.ResponseWriter, r *http.Request, logger *slog.Logger)
- func BadRequestResponse(w http.ResponseWriter, r *http.Request, logger *slog.Logger, err error)
- func EditConflictResponse(w http.ResponseWriter, r *http.Request, logger *slog.Logger)
- func ErrorResponse(w http.ResponseWriter, r *http.Request, logger *slog.Logger, status int, ...)
- func FailedValidationResponse(w http.ResponseWriter, r *http.Request, logger *slog.Logger, ...)
- func InvalidAuthenticationTokenResponse(w http.ResponseWriter, r *http.Request, logger *slog.Logger)
- func LogError(r *http.Request, logger *slog.Logger, err error)
- func MethodNotAllowedResponse(w http.ResponseWriter, r *http.Request, logger *slog.Logger)
- func NotFoundResponse(w http.ResponseWriter, r *http.Request, logger *slog.Logger)
- func RateLimitExceededResponse(w http.ResponseWriter, r *http.Request, logger *slog.Logger)
- func ReadIDParam(r *http.Request) (int64, error)
- func ReadJSON(w http.ResponseWriter, r *http.Request, dst any) error
- func ServerErrorResponse(w http.ResponseWriter, r *http.Request, logger *slog.Logger, err error)
- func WriteJSON(w http.ResponseWriter, status int, data Envelope, headers http.Header) error
- type Envelope
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRecordNotFound = errors.New("record not found") ErrEditConflict = errors.New("edit conflict") )
Functions ¶
func AuthenticationRequiredResponse ¶ added in v0.2.1
func BadRequestResponse ¶ added in v0.2.1
func EditConflictResponse ¶ added in v0.2.1
func ErrorResponse ¶ added in v0.2.1
func FailedValidationResponse ¶ added in v0.2.1
func InvalidAuthenticationTokenResponse ¶ added in v0.2.1
func MethodNotAllowedResponse ¶ added in v0.2.1
func NotFoundResponse ¶ added in v0.2.1
func RateLimitExceededResponse ¶ added in v0.2.1
func ReadIDParam ¶ added in v0.2.1
Retrieve the "id" URL parameter from the current request context, then convert it to an integer and return it. If the operation isn't successful, return 0 and an error.
func ServerErrorResponse ¶ added in v0.2.1
Types ¶
Click to show internal directories.
Click to hide internal directories.