-
Notifications
You must be signed in to change notification settings - Fork 0
/
method.go
49 lines (38 loc) · 1.2 KB
/
method.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
package middleware
func (e *Engine) GET(pattern string, handler HandlerFunc) {
e.AddRoute("GET", pattern, handler)
}
func (e *Engine) HEAD(pattern string, handler HandlerFunc) {
e.AddRoute("HEAD", pattern, handler)
}
func (e *Engine) POST(pattern string, handler HandlerFunc) {
e.AddRoute("POST", pattern, handler)
}
func (e *Engine) PUT(pattern string, handler HandlerFunc) {
e.AddRoute("PUT", pattern, handler)
}
func (e *Engine) DELETE(pattern string, handler HandlerFunc) {
e.AddRoute("DELETE", pattern, handler)
}
func (e *Engine) CONNECT(pattern string, handler HandlerFunc) {
e.AddRoute("CONNECT", pattern, handler)
}
func (e *Engine) OPTIONS(pattern string, handler HandlerFunc) {
e.AddRoute("OPTIONS", pattern, handler)
}
func (e *Engine) TRACE(pattern string, handler HandlerFunc) {
e.AddRoute("TRACE", pattern, handler)
}
func (e *Engine) PATCH(pattern string, handler HandlerFunc) {
e.AddRoute("PATCH", pattern, handler)
}
func (e *Engine) Other(method string, pattern string, handler HandlerFunc) {
e.AddRoute(method, pattern, handler)
}
func (e *Engine) Route(pattern string, handler HandlerFunc) {
e.routes = append(e.routes, &route{
method: "",
pattern: pattern,
handler: handler,
})
}