/
methods.go
51 lines (44 loc) · 1.07 KB
/
methods.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package pat
/*
Delete returns a Pat route that only matches the DELETE HTTP method.
*/
func Delete(pat string) *Pattern {
return newWithMethods(pat, "DELETE")
}
/*
Get returns a Pat route that only matches the GET and HEAD HTTP method. HEAD
requests are handled transparently by net/http.
*/
func Get(pat string) *Pattern {
return newWithMethods(pat, "GET", "HEAD")
}
/*
Head returns a Pat route that only matches the HEAD HTTP method.
*/
func Head(pat string) *Pattern {
return newWithMethods(pat, "HEAD")
}
/*
Options returns a Pat route that only matches the OPTIONS HTTP method.
*/
func Options(pat string) *Pattern {
return newWithMethods(pat, "OPTIONS")
}
/*
Patch returns a Pat route that only matches the PATCH HTTP method.
*/
func Patch(pat string) *Pattern {
return newWithMethods(pat, "PATCH")
}
/*
Post returns a Pat route that only matches the POST HTTP method.
*/
func Post(pat string) *Pattern {
return newWithMethods(pat, "POST")
}
/*
Put returns a Pat route that only matches the PUT HTTP method.
*/
func Put(pat string) *Pattern {
return newWithMethods(pat, "PUT")
}