Documentation
¶
Index ¶
- Variables
- func DecodeJSON(r *http.Request, v any) error
- func FormField(r *http.Request, key string) (string, error)
- func NumberParam[T Number](r *http.Request, key string) (T, error)
- func Payload[T any](r *http.Request) (T, error)
- func PayloadMap(r *http.Request) (map[string]any, error)
- func PayloadWithValidate[T any](r *http.Request) (T, error)
- type Number
- type Pager
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxRequestBodySize int64 = 1 << 20 // 1MB
MaxRequestBodySize is the maximum allowed size for request bodies (1MB default). This prevents resource exhaustion attacks from large payloads. Override this value if you need to accept larger requests.
Functions ¶
func DecodeJSON ¶ added in v0.3.0
DecodeJSON decodes JSON from the request body into the provided pointer. This is useful when you want to decode into an existing variable. The request body size is limited by MaxRequestBodySize to prevent DoS attacks.
func NumberParam ¶
NumberParam from request query string
Types ¶
Click to show internal directories.
Click to hide internal directories.