Documentation
¶
Overview ¶
Package jsonmw provides jsonmw utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Middleware ¶
type Middleware struct {
RequireJSON bool
}
Middleware enforces JSON content-type requirements.
func New ¶
func New(opts Options) (*Middleware, error)
New constructs a JSON middleware with the given requirement.
func (*Middleware) Handler ¶
func (m *Middleware) Handler(next http.Handler) http.Handler
Handler wraps the next handler with JSON content checks.
func (*Middleware) Middleware ¶
func (m *Middleware) Middleware() func(http.Handler) http.Handler
Middleware implements ports.Middleware by returning the Handler adapter.
Click to show internal directories.
Click to hide internal directories.