Feat: done tcp
This commit is contained in:
16
middlewares/accessLog.go
Normal file
16
middlewares/accessLog.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package middlewares
|
||||
|
||||
import (
|
||||
"inp2025/tcp"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func AccessLog(next tcp.Handler) tcp.Handler {
|
||||
return func(w tcp.ResponseWriter, req *tcp.Request) error {
|
||||
zap.L().Info("access",
|
||||
zap.String("method", string(req.Method)),
|
||||
zap.String("route", req.Route))
|
||||
return next(w, req)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user