http

package
Version: v0.0.0-...-ec7f410 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2014 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegexPath

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.

Types

type HttpError

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

func NewHttpError(err error, sc int) HttpError

Source Files

Directories

Path Synopsis
Package cachecontrol provides an HTTP decorator which adds cache-control headers to outgoing responses
Package cachecontrol provides an HTTP decorator which adds cache-control headers to outgoing responses
Package log is for http logging
Package log is for http logging
Package panichandler provides An HTTP decorator which recovers from `panic`
Package panichandler provides An HTTP decorator which recovers from `panic`
Package http decorates an http.Handler and prevents too many requests being made
Package http decorates an http.Handler and prevents too many requests being made
Package secure_headers decorates an http.Handler and sets several key security headers
Package secure_headers decorates an http.Handler and sets several key security headers
csp
package csp implements a content-security-policy header generator
package csp implements a content-security-policy header generator

Jump to

Keyboard shortcuts

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