regexp_replace

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: 0BSD Imports: 6 Imported by: 0

README

caddy-regexp-replace

amibitions to become a fully fledged caddy module

today, it's nothing more than a regex wrapper

regexp.MustCompile(`\.`).ReplaceAll(request.Host, []byte("-"))

Use with Caddy

xcaddy build --with git.sr.ht/~sbaildon/caddy-regexp-replace

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware struct {
	// The file or stream to write to. Can be "stdout"
	// or "stderr".
	Name   string `json:"name,omitempty"`
	Source string `json:"source,omitempty"`
	// contains filtered or unexported fields
}

Middleware implements an HTTP handler that writes the visitor's IP address to a file or stream.

func (Middleware) CaddyModule

func (Middleware) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Middleware) Provision

func (m *Middleware) Provision(ctx caddy.Context) (err error)

Provision implements caddy.Provisioner.

func (Middleware) ServeHTTP

func (m Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

ServeHTTP implements caddyhttp.MiddlewareHandler.

func (*Middleware) UnmarshalCaddyfile

func (m *Middleware) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

Jump to

Keyboard shortcuts

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