Documentation
¶
Overview ¶
Package maxbody provides maxbody utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware struct {
MaxBytes int64
}
Middleware enforces a maximum request body size.
func New ¶
func New(opts Options) (*Middleware, error)
New constructs a max-body middleware with the given limit.
func (*Middleware) Handler ¶
func (m *Middleware) Handler(next http.Handler) http.Handler
Handler wraps the next handler with body size limits.
func (*Middleware) Middleware ¶
func (m *Middleware) Middleware() func(http.Handler) http.Handler
Middleware implements ports.Middleware via Handler adapter.
Click to show internal directories.
Click to hide internal directories.