-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.go
55 lines (41 loc) · 1.32 KB
/
default.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
52
53
54
55
package ginserver
import (
"net/http"
"github.com/gin-gonic/gin"
)
var (
Default = StdConfig("default").Build()
)
func Run() error {
return Default.Run()
}
func Use(middleware ...gin.HandlerFunc) gin.IRoutes {
return Default.Use(middleware...)
}
func Any(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
return Default.Any(relativePath, handlers...)
}
func DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
return Default.DELETE(relativePath, handlers...)
}
func GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
return Default.GET(relativePath, handlers...)
}
func HEAD(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
return Default.HEAD(relativePath, handlers...)
}
func OPTIONS(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
return Default.OPTIONS(relativePath, handlers...)
}
func PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
return Default.PATCH(relativePath, handlers...)
}
func POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
return Default.POST(relativePath, handlers...)
}
func PUT(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes {
return Default.PUT(relativePath, handlers...)
}
func ServeHTTP(w http.ResponseWriter, req *http.Request) {
Default.ServeHTTP(w, req)
}