Documentation
¶
Index ¶
- func Chain(handler http.Handler, middleware ...Middleware) http.Handler
- func DecodeJSON(r *http.Request, dst any) error
- func RequestID(next http.Handler) http.Handler
- func RequestIDFromContext(ctx context.Context) string
- func RequireJSON(r *http.Request) bool
- func WriteError(w http.ResponseWriter, status int, code string, message string)
- func WriteJSON(w http.ResponseWriter, status int, body any)
- type Middleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestIDFromContext ¶
func RequireJSON ¶
func WriteError ¶
func WriteError(w http.ResponseWriter, status int, code string, message string)
Types ¶
type Middleware ¶
func MaxBytes ¶
func MaxBytes(limit int64) Middleware
func Recover ¶
func Recover(logger *slog.Logger) Middleware
func Timeout ¶
func Timeout(timeout time.Duration) Middleware
Click to show internal directories.
Click to hide internal directories.