Back to godoc.org

Package util

v0.1.73
Latest Go to latest

The latest major version is .

Published: 4 days ago | License: MIT | Module: github.com/pace/bricks

Index

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.

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier