Help us shape the future of Go! Take the 2026 Go Developer Survey

replacepathregex

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init added in v0.9.0

func Init() error

Init registers the replace_path_regex middleware.

Types

type Config added in v0.8.0

type Config struct {
	Regex       string `mapstructure:"regex"`
	Replacement string `mapstructure:"replacement"`
}

Config defines the configuration for the replace_path_regex middleware.

type Middleware added in v0.10.0

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware is a middleware that replaces the request path using a regular expression.

func NewMiddleware

func NewMiddleware(regex, replacement string) (*Middleware, error)

NewMiddleware creates a new ReplacePathRegexMiddleware instance.

func (*Middleware) ServeHTTP added in v0.10.0

func (m *Middleware) ServeHTTP(ctx context.Context, c *app.RequestContext)

Jump to

Keyboard shortcuts

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