method

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2018 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	GET    Verb = "GET"
	POST        = "POST"
	PUT         = "PUT"
	DELETE      = "DELETE"
	HEAD        = "HEAD"
	PATCH       = "PATCH"
)

Variables

This section is empty.

Functions

func Delete

func Delete(h http.Handler) http.Handler

Delete returns a handler that allows only DELETE requests to pass.

func Get

func Get(h http.Handler) http.Handler

Get returns a handler that allows only GET requests to pass.

func HTTP

func HTTP(h http.Handler, verb Verb, verbs ...Verb) http.Handler

HTTP returns a handler that will check each request's method against a predefined whitelist. If the request's method is not part of the list, the response will be a 400 Bad Request.

func Post

func Post(h http.Handler) http.Handler

Post returns a handler that allows only POST requests to pass.

func Put

func Put(h http.Handler) http.Handler

Put returns a handler that allows only PUT requests to pass.

Types

type Verb

type Verb string

Jump to

Keyboard shortcuts

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