goodies: github.com/99designs/goodies/http Index | Files | Directories

package http

import "github.com/99designs/goodies/http"

Index

Package Files

error.go http.go

func RegexPath Uses

func RegexPath(reg *regexp.Regexp, h http.Handler) http.Handler

RegexPath returns a handler that serves HTTP requests with the first match of the the given regex from the request URL's Path and invoking the handler h. RegexPath handles a request for a path that doesn't match by replying with an HTTP 404 not found error.

type HttpError Uses

type HttpError interface {
    Error() string   // the original error
    StatusCode() int // a suggested http error code
}

HttpError is used as a convenient way to be able to panic and ensure that a particular http status code will be returned

func NewHttpError Uses

func NewHttpError(err error, sc int) HttpError

Directories

PathSynopsis
cachecontrolPackage cachecontrol provides an HTTP decorator which adds cache-control headers to outgoing responses
logPackage log is for http logging
max_bytes
panichandlerPackage panichandler provides An HTTP decorator which recovers from `panic`
ratelimiterPackage http decorates an http.Handler and prevents too many requests being made
secure_headersPackage secure_headers decorates an http.Handler and sets several key security headers
secure_headers/csppackage csp implements a content-security-policy header generator
statsd

Package http imports 2 packages (graph) and is imported by 2 packages. Updated 2016-07-18. Refresh now. Tools for package owners.