mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-18 13:07:35 -06:00
[feature/performance] Wrap incoming HTTP requests in timeout handler (#2353)
* deinterface router, start messing about with deadlines * weeeee * thanks linter (thinter) * write Connection: close when timing out requests * update wording * don't replace req * don't bother with fancy Cause functions (I'll use them one day...)
This commit is contained in:
parent
7753f42132
commit
8d0c017cf2
14 changed files with 305 additions and 175 deletions
|
|
@ -19,18 +19,18 @@ package router
|
|||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func (r *router) AttachGlobalMiddleware(handlers ...gin.HandlerFunc) gin.IRoutes {
|
||||
func (r *Router) AttachGlobalMiddleware(handlers ...gin.HandlerFunc) gin.IRoutes {
|
||||
return r.engine.Use(handlers...)
|
||||
}
|
||||
|
||||
func (r *router) AttachNoRouteHandler(handler gin.HandlerFunc) {
|
||||
func (r *Router) AttachNoRouteHandler(handler gin.HandlerFunc) {
|
||||
r.engine.NoRoute(handler)
|
||||
}
|
||||
|
||||
func (r *router) AttachGroup(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup {
|
||||
func (r *Router) AttachGroup(relativePath string, handlers ...gin.HandlerFunc) *gin.RouterGroup {
|
||||
return r.engine.Group(relativePath, handlers...)
|
||||
}
|
||||
|
||||
func (r *router) AttachHandler(method string, path string, handler gin.HandlerFunc) {
|
||||
func (r *Router) AttachHandler(method string, path string, handler gin.HandlerFunc) {
|
||||
r.engine.Handle(method, path, handler)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue