util

package
v0.1.74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigurableHandler

func NewConfigurableHandler(next, actualHandler http.Handler, cfgs ...ConfigurableMiddlewareOption) *configurableHandler

NewConfigurableHandler creates a configurableHandler, that wraps anther handler. actualHandler is the handler, that is called if the request is not ignored

func NewIgnorePrefixMiddleware

func NewIgnorePrefixMiddleware(actualMiddleware func(http.Handler) http.Handler, prefixes ...string) func(http.Handler) http.Handler

NewIgnorePrefixMiddleware creates a middleware that wraps the actualMiddleware. The handler of this middleware skips the actual middleware if the path has a prefix of the prefixes slice.

Types

type ConfigurableMiddlewareOption

type ConfigurableMiddlewareOption func(*configurableHandler) error

ConfigurableMiddlewareOption is a functional option to configure the handler

func WithoutPrefixes

func WithoutPrefixes(prefix ...string) ConfigurableMiddlewareOption

WithoutPrefixes allows to configure the ignoredPrefix slice

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL