bricks: github.com/pace/bricks/maintenance/util Index | Files

package util

import "github.com/pace/bricks/maintenance/util"

Index

Package Files

ignore_prefix_handler.go

func NewConfigurableHandler Uses

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 Uses

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 Uses

type ConfigurableMiddlewareOption func(*configurableHandler) error

ConfigurableMiddlewareOption is a functional option to configure the handler

func WithoutPrefixes Uses

func WithoutPrefixes(prefix ...string) ConfigurableMiddlewareOption

WithoutPrefixes allows to configure the ignoredPrefix slice

Package util imports 3 packages (graph) and is imported by 1 packages. Updated 2020-02-03. Refresh now. Tools for package owners.