Feat: done tcp

This commit is contained in:
2025-11-10 10:02:55 +08:00
parent 78d89595a1
commit 9a39bcda40
17 changed files with 689 additions and 0 deletions

16
middlewares/accessLog.go Normal file
View 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)
}
}