restrictprefix

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestrictPrefix

type RestrictPrefix struct {
	Prefix string `json:"prefix,omitempty"`
	// contains filtered or unexported fields
}

RestrictPrefix is middleware that restricts requests where any portion of the URI matches a given prefix.

func (*RestrictPrefix) CaddyModule

func (*RestrictPrefix) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*RestrictPrefix) Provision

func (p *RestrictPrefix) Provision(ctx caddy.Context) error

Provision a Zap logger to RestrictPrefix.

func (*RestrictPrefix) ServeHTTP

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

ServeHTTP implements the caddyhttp.MiddlewareHandler interface.

func (*RestrictPrefix) UnmarshalCaddyfile added in v1.0.4

func (p *RestrictPrefix) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler.

Syntax:

restrict_prefix <prefix>

func (*RestrictPrefix) Validate

func (p *RestrictPrefix) Validate() error

Validate the prefix from the module's configuration, setting the default prefix "." if necessary.

Jump to

Keyboard shortcuts

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