Documentation ¶
Index ¶
- type RestrictPrefix
- func (*RestrictPrefix) CaddyModule() caddy.ModuleInfo
- func (p *RestrictPrefix) Provision(ctx caddy.Context) error
- func (p *RestrictPrefix) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
- func (p *RestrictPrefix) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (p *RestrictPrefix) Validate() error
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.
Click to show internal directories.
Click to hide internal directories.