mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-06-18 09:20:14 +00:00
feat: use dig for controllers
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/tinyauthapp/tinyauth/internal/utils/logger"
|
||||
"go.uber.org/dig"
|
||||
)
|
||||
|
||||
// See context middleware for explanation of why we have to do this
|
||||
@@ -21,9 +22,15 @@ type ZerologMiddleware struct {
|
||||
log *logger.Logger
|
||||
}
|
||||
|
||||
func NewZerologMiddleware(log *logger.Logger) *ZerologMiddleware {
|
||||
type ZerologMiddlewareInput struct {
|
||||
dig.In
|
||||
|
||||
Log *logger.Logger
|
||||
}
|
||||
|
||||
func NewZerologMiddleware(i ZerologMiddlewareInput) *ZerologMiddleware {
|
||||
return &ZerologMiddleware{
|
||||
log: log,
|
||||
log: i.Log,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user