caddy: github.com/mholt/caddy/caddyhttp/status Index | Files

package status

import "github.com/mholt/caddy/caddyhttp/status"

Package status is middleware for returning status code for requests

Index

Package Files

setup.go status.go

type Rule Uses

type Rule struct {
    // Base path. Request to this path and sub-paths will be answered with StatusCode
    Base string

    // Status code to return
    StatusCode int

    // Request matcher
    httpserver.RequestMatcher
}

Rule describes status rewriting rule

func NewRule Uses

func NewRule(basePath string, status int) *Rule

NewRule creates new Rule.

func (*Rule) BasePath Uses

func (rule *Rule) BasePath() string

BasePath implements httpserver.HandlerConfig interface

type Status Uses

type Status struct {
    Rules []httpserver.HandlerConfig
    Next  httpserver.Handler
}

Status is a middleware to return status code for request

func (Status) ServeHTTP Uses

func (status Status) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

ServeHTTP implements the httpserver.Handler interface

Package status imports 4 packages (graph) and is imported by 87 packages. Updated 2019-07-03. Refresh now. Tools for package owners.