Documentation
¶
Index ¶
- func Accepts(r *http.Request, contentType string) bool
- func All(r *http.Request) map[string]any
- func Boolean(r *http.Request, key string) bool
- func Collect(r *http.Request, keys ...string) *collection.Collection[any]
- func Except(r *http.Request, keys ...string) map[string]any
- func ExpectsJson(r *http.Request) bool
- func File(r *http.Request, key string) (any, error)
- func Float(r *http.Request, key string) float64
- func Has(r *http.Request, key string) bool
- func HasFile(r *http.Request, key string) bool
- func Input(r *http.Request, key string) string
- func Integer(r *http.Request, key string) int
- func Old(r *http.Request, key string, defaultValue ...string) string
- func Only(r *http.Request, keys ...string) map[string]any
- func Param(r *http.Request, key string) string
- func Post(r *http.Request, key string) string
- func Query(r *http.Request, key string) string
- func Validate(r *http.Request, form FormRequest) (map[string][]error, bool)
- func WantsJson(r *http.Request) bool
- type FormRequest
- type FormRequestAttributes
- type FormRequestFailed
- type FormRequestMessages
- type FormRequestPassed
- type FormRequestPrepare
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Collect ¶
func Collect(r *http.Request, keys ...string) *collection.Collection[any]
Collect returns selected (or all) input as a generic Collection.
func ExpectsJson ¶
ExpectsJson returns true if the client expects a JSON response (Accept or X-Requested-With).
func Input ¶
Input gets an input value from JSON body, form body, or query string (in that priority order).
func Old ¶
Old retrieves old input flashed from the previous request. It first checks the request context (if middleware stored it), then falls back to empty string. Full integration with session flash is done via middleware/session.go + session.Manager.Old().
Types ¶
type FormRequest ¶
FormRequest is the base interface for form validation requests. Only Authorize() and Rules() are required. Other methods are optional and checked via type assertions.
type FormRequestAttributes ¶
FormRequestAttributes provides custom attribute names for errors.
type FormRequestFailed ¶
FormRequestFailed is called after failed validation.
type FormRequestMessages ¶
FormRequestMessages provides custom validation messages.
type FormRequestPassed ¶
type FormRequestPassed interface {
PassedValidation()
}
FormRequestPassed is called after successful validation.