Documentation
¶
Overview ¶
Package methodfilter provides a middleware for filtering HTTP requests by methods.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNilOption = errors.New("option cannot be nil")
ErrNilOption is returned when an option is nil.
Functions ¶
func New ¶
func New(options ...func(m *Handler) error) (defs.Middleware, error)
New sets up the method filter middleware. Its parameters are functions manipulating an internal Config variable.
func WithLogLevel ¶
WithLogLevel configures the log level to use with the logger.
func WithLogger ¶
WithLogger configures the logger to use.
func WithMethods ¶
WithMethods sets the methods_filter configuration to allow the given methods to pass. If used multiple times, the allowed methods of the different calls are all enabled.
Types ¶
Click to show internal directories.
Click to hide internal directories.