-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrequest_types.go
More file actions
26 lines (20 loc) · 706 Bytes
/
request_types.go
File metadata and controls
26 lines (20 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package httpsuite
import "net/http"
// RequestParamSetter defines custom path parameter binding for request structs.
type RequestParamSetter interface {
SetParam(fieldName, value string) error
}
// ParamExtractor extracts a path parameter from a request.
type ParamExtractor func(r *http.Request, key string) string
// Validator validates request payloads without coupling the core package to a validation library.
type Validator interface {
Validate(any) *ProblemDetails
}
// ParseOptions configures request parsing behavior.
type ParseOptions struct {
MaxBodyBytes int64
Problems *ProblemConfig
Validator Validator
SkipValidation bool
}
const defaultMaxBodyBytes int64 = 1 << 20