first commit
This commit is contained in:
14
internal/middleware/timer.go
Normal file
14
internal/middleware/timer.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func RequestTimer() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
c.Set("startTime", time.Now())
|
||||
c.Next()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user