Versions in this module Expand all Collapse all v2 v2.1.0 May 2, 2026 Changes in this version + func ContentTypeAllowed(header string, allowed []MediaType) bool + func RequireAccept(allowed ...MediaType) func(http.Handler) http.Handler + func RequireContentType(allowed ...MediaType) func(http.Handler) http.Handler + type Accept struct + MediaType string + Order int + Params map[string]string + Q float64 + Subtype string + Type string + func ParseAccept(header string) ([]Accept, error) + type Config struct + Accept []MediaType + ContentTypes []MediaType + type MediaType string + func Negotiate(header string, offered []MediaType) (MediaType, bool) + type Middleware struct + func New(config Config) (*Middleware, error) + func (m *Middleware) Handler(next http.Handler) http.Handler + func (m *Middleware) Middleware() func(http.Handler) http.Handler